@qite/tide-booking-component 1.4.73 → 1.4.75

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.
@@ -6994,10 +6994,13 @@ var build = {};
6994
6994
  allotment: 2
6995
6995
  };
6996
6996
 
6997
- var AvailabilitySearchType = {
6998
- default: 0,
6999
- allotment: 1
7000
- };
6997
+ exports.AvailabilitySearchType = void 0;
6998
+ (function (AvailabilitySearchType) {
6999
+ AvailabilitySearchType[(AvailabilitySearchType['default'] = 0)] = 'default';
7000
+ AvailabilitySearchType[(AvailabilitySearchType['allotment'] = 1)] = 'allotment';
7001
+ AvailabilitySearchType[(AvailabilitySearchType['fixedDuration'] = 2)] = 'fixedDuration';
7002
+ AvailabilitySearchType[(AvailabilitySearchType['flight'] = 3)] = 'flight';
7003
+ })(exports.AvailabilitySearchType || (exports.AvailabilitySearchType = {}));
7001
7004
 
7002
7005
  var DataType = {
7003
7006
  text: 'text',
@@ -7199,6 +7202,27 @@ var build = {};
7199
7202
  sunnyCars: 20
7200
7203
  };
7201
7204
 
7205
+ exports.DateAmountType = void 0;
7206
+ (function (DateAmountType) {
7207
+ DateAmountType[(DateAmountType['days'] = 0)] = 'days';
7208
+ DateAmountType[(DateAmountType['months'] = 1)] = 'months';
7209
+ })(exports.DateAmountType || (exports.DateAmountType = {}));
7210
+
7211
+ exports.PortalQsmType = void 0;
7212
+ (function (PortalQsmType) {
7213
+ PortalQsmType[(PortalQsmType['Multidestination'] = 0)] = 'Multidestination';
7214
+ PortalQsmType[(PortalQsmType['Accommodation'] = 1)] = 'Accommodation';
7215
+ PortalQsmType[(PortalQsmType['AccommodationAndFlight'] = 2)] = 'AccommodationAndFlight';
7216
+ PortalQsmType[(PortalQsmType['Flight'] = 3)] = 'Flight';
7217
+ PortalQsmType[(PortalQsmType['RoundTrip'] = 4)] = 'RoundTrip';
7218
+ PortalQsmType[(PortalQsmType['GroupTour'] = 5)] = 'GroupTour';
7219
+ PortalQsmType[(PortalQsmType['Package'] = 6)] = 'Package';
7220
+ PortalQsmType[(PortalQsmType['Ticket'] = 7)] = 'Ticket';
7221
+ PortalQsmType[(PortalQsmType['Car'] = 8)] = 'Car';
7222
+ PortalQsmType[(PortalQsmType['Transfer'] = 9)] = 'Transfer';
7223
+ PortalQsmType[(PortalQsmType['Cruise'] = 10)] = 'Cruise';
7224
+ })(exports.PortalQsmType || (exports.PortalQsmType = {}));
7225
+
7202
7226
  /******************************************************************************
7203
7227
  Copyright (c) Microsoft Corporation.
7204
7228
 
@@ -13195,6 +13219,9 @@ PERFORMANCE OF THIS SOFTWARE.
13195
13219
  var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$2 + '/translation-dictionary';
13196
13220
  var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$2 + '/booking-accommodation';
13197
13221
  var ENDPOINT_LOCATIONS = ENDPOINT$2 + '/entity/locations';
13222
+ var ENDPOINT_WEBSITE_CONFIGURATION = function (portalId) {
13223
+ return ENDPOINT$2 + '/website/' + portalId + '/configuration';
13224
+ };
13198
13225
  /**
13199
13226
  * api/web/crmcontact
13200
13227
  * Creates a CRM contact.
@@ -13252,6 +13279,11 @@ PERFORMANCE OF THIS SOFTWARE.
13252
13279
  var body = JSON.stringify(request);
13253
13280
  return post(url, apiKey, body, config.token, signal);
13254
13281
  };
13282
+ var getWebsiteConfiguration = function (config, id, signal) {
13283
+ var url = '' + config.host + ENDPOINT_WEBSITE_CONFIGURATION(id);
13284
+ var apiKey = config.apiKey;
13285
+ return get(url, apiKey, config.token, signal, true);
13286
+ };
13255
13287
 
13256
13288
  var ENDPOINT$1 = '/api/web/contact';
13257
13289
  var ENDPOINT_CONTACT_FORM = ENDPOINT$1 + '/contact-form';
@@ -13308,7 +13340,6 @@ PERFORMANCE OF THIS SOFTWARE.
13308
13340
  };
13309
13341
 
13310
13342
  exports.AllotmentType = AllotmentType;
13311
- exports.AvailabilitySearchType = AvailabilitySearchType;
13312
13343
  exports.ContactForm = ContactForm;
13313
13344
  exports.DataType = DataType;
13314
13345
  exports.DossierType = DossierType;
@@ -13363,6 +13394,7 @@ PERFORMANCE OF THIS SOFTWARE.
13363
13394
  exports.getPortal = getPortal;
13364
13395
  exports.getPrintActions = getPrintActions;
13365
13396
  exports.getTranslationDictionary = getTranslationDictionary;
13397
+ exports.getWebsiteConfiguration = getWebsiteConfiguration;
13366
13398
  exports.login = login;
13367
13399
  exports.logout = logout;
13368
13400
  exports.priceDetails = priceDetails;
@@ -33049,9 +33081,8 @@ var QSMContainer = function () {
33049
33081
  [fromDate, toDate]
33050
33082
  );
33051
33083
  var handleDateChange = function (value) {
33052
- var _a, _b;
33053
- dispatch(setFromDate((_a = value.fromDate) === null || _a === void 0 ? void 0 : _a.toISOString()));
33054
- dispatch(setToDate((_b = value.toDate) === null || _b === void 0 ? void 0 : _b.toISOString()));
33084
+ dispatch(setFromDate(value.fromDate ? dateFns.format(value.fromDate, 'yyyy-MM-dd') : undefined));
33085
+ dispatch(setToDate(value.toDate ? dateFns.format(value.toDate, 'yyyy-MM-dd') : undefined));
33055
33086
  };
33056
33087
  var handleTripTypeChange = function (value) {
33057
33088
  dispatch(setTripType(value));
@@ -38619,7 +38650,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38619
38650
  if (!results || results.length === 0 || !filters) {
38620
38651
  return filters !== null && filters !== void 0 ? filters : [];
38621
38652
  }
38622
- var _loop_1 = function (filter) {
38653
+ return filters.map(function (filter) {
38654
+ var updatedFilter = __assign({}, filter);
38623
38655
  if (filter.property === 'price' && (filter.min == null || filter.max == null)) {
38624
38656
  var prices = results
38625
38657
  .map(function (r) {
@@ -38630,8 +38662,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38630
38662
  return p > 0;
38631
38663
  });
38632
38664
  if (prices.length > 0) {
38633
- filter.min = Math.floor(Math.min.apply(Math, prices));
38634
- filter.max = Math.ceil(Math.max.apply(Math, prices));
38665
+ updatedFilter.min = Math.floor(Math.min.apply(Math, prices));
38666
+ updatedFilter.max = Math.ceil(Math.max.apply(Math, prices));
38635
38667
  }
38636
38668
  }
38637
38669
  if (filter.property === 'accommodation') {
@@ -38644,8 +38676,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38644
38676
  });
38645
38677
  }
38646
38678
  });
38647
- console.log('map', map_1);
38648
- filter.options = Array.from(map_1.values()).map(function (accommodation) {
38679
+ updatedFilter.options = Array.from(map_1.values()).map(function (accommodation) {
38649
38680
  var _a;
38650
38681
  return {
38651
38682
  label: (_a = accommodation.name) !== null && _a !== void 0 ? _a : accommodation.code,
@@ -38664,7 +38695,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38664
38695
  });
38665
38696
  }
38666
38697
  });
38667
- filter.options = Array.from(map_2.values()).map(function (regime) {
38698
+ updatedFilter.options = Array.from(map_2.values()).map(function (regime) {
38668
38699
  var _a;
38669
38700
  return {
38670
38701
  label: (_a = regime.name) !== null && _a !== void 0 ? _a : regime.code,
@@ -38688,7 +38719,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38688
38719
  }
38689
38720
  });
38690
38721
  });
38691
- filter.options = Array.from(map_3.values()).map(function (theme) {
38722
+ updatedFilter.options = Array.from(map_3.values()).map(function (theme) {
38692
38723
  return {
38693
38724
  label: theme.name,
38694
38725
  value: theme.id,
@@ -38696,12 +38727,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38696
38727
  };
38697
38728
  });
38698
38729
  }
38699
- };
38700
- for (var _i = 0, filters_1 = filters; _i < filters_1.length; _i++) {
38701
- var filter = filters_1[_i];
38702
- _loop_1(filter);
38703
- }
38704
- return filters;
38730
+ return updatedFilter;
38731
+ });
38705
38732
  };
38706
38733
 
38707
38734
  var ticksToMinutes = function (ticks) {
@@ -7025,10 +7025,13 @@ var build = {};
7025
7025
  allotment: 2
7026
7026
  };
7027
7027
 
7028
- var AvailabilitySearchType = {
7029
- default: 0,
7030
- allotment: 1
7031
- };
7028
+ exports.AvailabilitySearchType = void 0;
7029
+ (function (AvailabilitySearchType) {
7030
+ AvailabilitySearchType[(AvailabilitySearchType['default'] = 0)] = 'default';
7031
+ AvailabilitySearchType[(AvailabilitySearchType['allotment'] = 1)] = 'allotment';
7032
+ AvailabilitySearchType[(AvailabilitySearchType['fixedDuration'] = 2)] = 'fixedDuration';
7033
+ AvailabilitySearchType[(AvailabilitySearchType['flight'] = 3)] = 'flight';
7034
+ })(exports.AvailabilitySearchType || (exports.AvailabilitySearchType = {}));
7032
7035
 
7033
7036
  var DataType = {
7034
7037
  text: 'text',
@@ -7230,6 +7233,27 @@ var build = {};
7230
7233
  sunnyCars: 20
7231
7234
  };
7232
7235
 
7236
+ exports.DateAmountType = void 0;
7237
+ (function (DateAmountType) {
7238
+ DateAmountType[(DateAmountType['days'] = 0)] = 'days';
7239
+ DateAmountType[(DateAmountType['months'] = 1)] = 'months';
7240
+ })(exports.DateAmountType || (exports.DateAmountType = {}));
7241
+
7242
+ exports.PortalQsmType = void 0;
7243
+ (function (PortalQsmType) {
7244
+ PortalQsmType[(PortalQsmType['Multidestination'] = 0)] = 'Multidestination';
7245
+ PortalQsmType[(PortalQsmType['Accommodation'] = 1)] = 'Accommodation';
7246
+ PortalQsmType[(PortalQsmType['AccommodationAndFlight'] = 2)] = 'AccommodationAndFlight';
7247
+ PortalQsmType[(PortalQsmType['Flight'] = 3)] = 'Flight';
7248
+ PortalQsmType[(PortalQsmType['RoundTrip'] = 4)] = 'RoundTrip';
7249
+ PortalQsmType[(PortalQsmType['GroupTour'] = 5)] = 'GroupTour';
7250
+ PortalQsmType[(PortalQsmType['Package'] = 6)] = 'Package';
7251
+ PortalQsmType[(PortalQsmType['Ticket'] = 7)] = 'Ticket';
7252
+ PortalQsmType[(PortalQsmType['Car'] = 8)] = 'Car';
7253
+ PortalQsmType[(PortalQsmType['Transfer'] = 9)] = 'Transfer';
7254
+ PortalQsmType[(PortalQsmType['Cruise'] = 10)] = 'Cruise';
7255
+ })(exports.PortalQsmType || (exports.PortalQsmType = {}));
7256
+
7233
7257
  /******************************************************************************
7234
7258
  Copyright (c) Microsoft Corporation.
7235
7259
 
@@ -13226,6 +13250,9 @@ PERFORMANCE OF THIS SOFTWARE.
13226
13250
  var ENDPOINT_TRANSLATION_DICTIONARY = ENDPOINT$2 + '/translation-dictionary';
13227
13251
  var ENDPOINT_BOOKING_ACCOMMODATION = ENDPOINT$2 + '/booking-accommodation';
13228
13252
  var ENDPOINT_LOCATIONS = ENDPOINT$2 + '/entity/locations';
13253
+ var ENDPOINT_WEBSITE_CONFIGURATION = function (portalId) {
13254
+ return ENDPOINT$2 + '/website/' + portalId + '/configuration';
13255
+ };
13229
13256
  /**
13230
13257
  * api/web/crmcontact
13231
13258
  * Creates a CRM contact.
@@ -13283,6 +13310,11 @@ PERFORMANCE OF THIS SOFTWARE.
13283
13310
  var body = JSON.stringify(request);
13284
13311
  return post(url, apiKey, body, config.token, signal);
13285
13312
  };
13313
+ var getWebsiteConfiguration = function (config, id, signal) {
13314
+ var url = '' + config.host + ENDPOINT_WEBSITE_CONFIGURATION(id);
13315
+ var apiKey = config.apiKey;
13316
+ return get(url, apiKey, config.token, signal, true);
13317
+ };
13286
13318
 
13287
13319
  var ENDPOINT$1 = '/api/web/contact';
13288
13320
  var ENDPOINT_CONTACT_FORM = ENDPOINT$1 + '/contact-form';
@@ -13339,7 +13371,6 @@ PERFORMANCE OF THIS SOFTWARE.
13339
13371
  };
13340
13372
 
13341
13373
  exports.AllotmentType = AllotmentType;
13342
- exports.AvailabilitySearchType = AvailabilitySearchType;
13343
13374
  exports.ContactForm = ContactForm;
13344
13375
  exports.DataType = DataType;
13345
13376
  exports.DossierType = DossierType;
@@ -13394,6 +13425,7 @@ PERFORMANCE OF THIS SOFTWARE.
13394
13425
  exports.getPortal = getPortal;
13395
13426
  exports.getPrintActions = getPrintActions;
13396
13427
  exports.getTranslationDictionary = getTranslationDictionary;
13428
+ exports.getWebsiteConfiguration = getWebsiteConfiguration;
13397
13429
  exports.login = login;
13398
13430
  exports.logout = logout;
13399
13431
  exports.priceDetails = priceDetails;
@@ -32914,9 +32946,8 @@ var QSMContainer = function () {
32914
32946
  [fromDate, toDate]
32915
32947
  );
32916
32948
  var handleDateChange = function (value) {
32917
- var _a, _b;
32918
- dispatch(setFromDate((_a = value.fromDate) === null || _a === void 0 ? void 0 : _a.toISOString()));
32919
- dispatch(setToDate((_b = value.toDate) === null || _b === void 0 ? void 0 : _b.toISOString()));
32949
+ dispatch(setFromDate(value.fromDate ? format$1(value.fromDate, 'yyyy-MM-dd') : undefined));
32950
+ dispatch(setToDate(value.toDate ? format$1(value.toDate, 'yyyy-MM-dd') : undefined));
32920
32951
  };
32921
32952
  var handleTripTypeChange = function (value) {
32922
32953
  dispatch(setTripType(value));
@@ -38377,7 +38408,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38377
38408
  if (!results || results.length === 0 || !filters) {
38378
38409
  return filters !== null && filters !== void 0 ? filters : [];
38379
38410
  }
38380
- var _loop_1 = function (filter) {
38411
+ return filters.map(function (filter) {
38412
+ var updatedFilter = __assign({}, filter);
38381
38413
  if (filter.property === 'price' && (filter.min == null || filter.max == null)) {
38382
38414
  var prices = results
38383
38415
  .map(function (r) {
@@ -38388,8 +38420,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38388
38420
  return p > 0;
38389
38421
  });
38390
38422
  if (prices.length > 0) {
38391
- filter.min = Math.floor(Math.min.apply(Math, prices));
38392
- filter.max = Math.ceil(Math.max.apply(Math, prices));
38423
+ updatedFilter.min = Math.floor(Math.min.apply(Math, prices));
38424
+ updatedFilter.max = Math.ceil(Math.max.apply(Math, prices));
38393
38425
  }
38394
38426
  }
38395
38427
  if (filter.property === 'accommodation') {
@@ -38402,8 +38434,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38402
38434
  });
38403
38435
  }
38404
38436
  });
38405
- console.log('map', map_1);
38406
- filter.options = Array.from(map_1.values()).map(function (accommodation) {
38437
+ updatedFilter.options = Array.from(map_1.values()).map(function (accommodation) {
38407
38438
  var _a;
38408
38439
  return {
38409
38440
  label: (_a = accommodation.name) !== null && _a !== void 0 ? _a : accommodation.code,
@@ -38422,7 +38453,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38422
38453
  });
38423
38454
  }
38424
38455
  });
38425
- filter.options = Array.from(map_2.values()).map(function (regime) {
38456
+ updatedFilter.options = Array.from(map_2.values()).map(function (regime) {
38426
38457
  var _a;
38427
38458
  return {
38428
38459
  label: (_a = regime.name) !== null && _a !== void 0 ? _a : regime.code,
@@ -38446,7 +38477,7 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38446
38477
  }
38447
38478
  });
38448
38479
  });
38449
- filter.options = Array.from(map_3.values()).map(function (theme) {
38480
+ updatedFilter.options = Array.from(map_3.values()).map(function (theme) {
38450
38481
  return {
38451
38482
  label: theme.name,
38452
38483
  value: theme.id,
@@ -38454,12 +38485,8 @@ var enrichFiltersWithResults = function (results, filters, tags) {
38454
38485
  };
38455
38486
  });
38456
38487
  }
38457
- };
38458
- for (var _i = 0, filters_1 = filters; _i < filters_1.length; _i++) {
38459
- var filter = filters_1[_i];
38460
- _loop_1(filter);
38461
- }
38462
- return filters;
38488
+ return updatedFilter;
38489
+ });
38463
38490
  };
38464
38491
 
38465
38492
  var ticksToMinutes = function (ticks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.4.73",
3
+ "version": "1.4.75",
4
4
  "description": "React Booking wizard & Booking product component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "types": "build/build-cjs/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@jsonurl/jsonurl": "^1.1.4",
31
31
  "@popperjs/core": "^2.10.2",
32
- "@qite/tide-client": "^1.1.144",
32
+ "@qite/tide-client": "^1.1.145",
33
33
  "@reduxjs/toolkit": "^2.8.2",
34
34
  "@rollup/plugin-commonjs": "^19.0.1",
35
35
  "@rollup/plugin-json": "^4.1.0",
@@ -12,7 +12,7 @@ import TravelClassPicker from '../travel-class-picker';
12
12
  import TravelTypePicker from '../travel-type-picker';
13
13
  import Icon from '../icon';
14
14
  import TravelNationalityPicker from '../travel-nationality-picker';
15
- import { addDays, addMonths, addYears } from 'date-fns';
15
+ import { addDays, addMonths, addYears, format } from 'date-fns';
16
16
  import { DateRange } from '../../../booking-product/types';
17
17
  import { QSMState, setFromDate, setSelectedQsmType, setToDate, setTripType } from '../../store/qsm-slice';
18
18
  import { BaseFieldConfig, DoubleFieldConfig } from '../../types';
@@ -69,8 +69,8 @@ const QSMContainer: React.FC = () => {
69
69
  }, [fromDate, toDate]);
70
70
 
71
71
  const handleDateChange = (value: DateRange) => {
72
- dispatch(setFromDate(value.fromDate?.toISOString()));
73
- dispatch(setToDate(value.toDate?.toISOString()));
72
+ dispatch(setFromDate(value.fromDate ? format(value.fromDate, 'yyyy-MM-dd') : undefined));
73
+ dispatch(setToDate(value.toDate ? format(value.toDate, 'yyyy-MM-dd') : undefined));
74
74
  };
75
75
 
76
76
  const handleTripTypeChange = (value: 'oneway' | 'roundtrip' | 'openjaw') => {
@@ -6,12 +6,14 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
6
6
  return filters ?? [];
7
7
  }
8
8
 
9
- for (const filter of filters) {
9
+ return filters.map((filter) => {
10
+ let updatedFilter = { ...filter };
11
+
10
12
  if (filter.property === 'price' && (filter.min == null || filter.max == null)) {
11
13
  const prices = results.map((r) => r.price ?? 0).filter((p) => p > 0);
12
14
  if (prices.length > 0) {
13
- filter.min = Math.floor(Math.min(...prices));
14
- filter.max = Math.ceil(Math.max(...prices));
15
+ updatedFilter.min = Math.floor(Math.min(...prices));
16
+ updatedFilter.max = Math.ceil(Math.max(...prices));
15
17
  }
16
18
  }
17
19
 
@@ -27,9 +29,7 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
27
29
  }
28
30
  });
29
31
 
30
- console.log('map', map);
31
-
32
- filter.options = Array.from(map.values()).map((accommodation) => ({
32
+ updatedFilter.options = Array.from(map.values()).map((accommodation) => ({
33
33
  label: accommodation.name ?? accommodation.code,
34
34
  value: accommodation.code,
35
35
  isChecked: false
@@ -48,7 +48,7 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
48
48
  }
49
49
  });
50
50
 
51
- filter.options = Array.from(map.values()).map((regime) => ({
51
+ updatedFilter.options = Array.from(map.values()).map((regime) => ({
52
52
  label: regime.name ?? regime.code,
53
53
  value: regime.code,
54
54
  isChecked: false
@@ -67,13 +67,13 @@ export const enrichFiltersWithResults = (results: BookingPackageItem[], filters:
67
67
  });
68
68
  });
69
69
 
70
- filter.options = Array.from(map.values()).map((theme) => ({
70
+ updatedFilter.options = Array.from(map.values()).map((theme) => ({
71
71
  label: theme.name,
72
72
  value: theme.id,
73
73
  isChecked: false
74
74
  }));
75
75
  }
76
- }
77
76
 
78
- return filters;
77
+ return updatedFilter;
78
+ });
79
79
  };