@qite/tide-booking-component 1.4.121 → 1.4.123
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/build/build-cjs/index.js
CHANGED
|
@@ -13855,7 +13855,8 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
13855
13855
|
|
|
13856
13856
|
var tideConnection = {
|
|
13857
13857
|
// host: 'https://localhost:44341',
|
|
13858
|
-
host: 'https://preview-tide.tidesoftware.be',
|
|
13858
|
+
// host: 'https://preview-tide.tidesoftware.be',
|
|
13859
|
+
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
13859
13860
|
apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
|
|
13860
13861
|
catalogueIds: [1],
|
|
13861
13862
|
officeId: 1
|
|
@@ -42187,6 +42188,13 @@ var Filters = function (_a) {
|
|
|
42187
42188
|
});
|
|
42188
42189
|
setFilters(updated);
|
|
42189
42190
|
};
|
|
42191
|
+
var handleStarRatingFilter = function (filter, rating) {
|
|
42192
|
+
var updated = filters.map(function (f) {
|
|
42193
|
+
if (f.property !== filter.property) return f;
|
|
42194
|
+
return __assign(__assign({}, f), { selectedRating: f.selectedRating === rating ? 0 : rating });
|
|
42195
|
+
});
|
|
42196
|
+
setFilters(updated);
|
|
42197
|
+
};
|
|
42190
42198
|
var handleSliderChange = function (filter, newMin, newMax) {
|
|
42191
42199
|
var updated = filters.map(function (f) {
|
|
42192
42200
|
if (f.property !== filter.property) return f;
|
|
@@ -42363,6 +42371,35 @@ var Filters = function (_a) {
|
|
|
42363
42371
|
handleSliderChange(filter, newMin, newMax);
|
|
42364
42372
|
}
|
|
42365
42373
|
});
|
|
42374
|
+
})(),
|
|
42375
|
+
isVisible &&
|
|
42376
|
+
filter.property === 'rating' &&
|
|
42377
|
+
filter.type === 'star-rating' &&
|
|
42378
|
+
(function () {
|
|
42379
|
+
var _a;
|
|
42380
|
+
var selectedRating = (_a = filter.selectedRating) !== null && _a !== void 0 ? _a : 0;
|
|
42381
|
+
return React__default['default'].createElement(
|
|
42382
|
+
'div',
|
|
42383
|
+
{ className: 'search__filter-row star-rating-filter' },
|
|
42384
|
+
[5, 4, 3, 2, 1].map(function (star) {
|
|
42385
|
+
return React__default['default'].createElement(
|
|
42386
|
+
'span',
|
|
42387
|
+
{
|
|
42388
|
+
key: star,
|
|
42389
|
+
className: 'star '.concat(star <= selectedRating ? 'filled' : ''),
|
|
42390
|
+
onClick: function () {
|
|
42391
|
+
return handleStarRatingFilter(filter, star);
|
|
42392
|
+
},
|
|
42393
|
+
role: 'button',
|
|
42394
|
+
tabIndex: 0,
|
|
42395
|
+
onKeyDown: function (e) {
|
|
42396
|
+
if (e.key === 'Enter' || e.key === ' ') handleStarRatingFilter(filter, star);
|
|
42397
|
+
}
|
|
42398
|
+
},
|
|
42399
|
+
'\u2605'
|
|
42400
|
+
);
|
|
42401
|
+
})
|
|
42402
|
+
);
|
|
42366
42403
|
})()
|
|
42367
42404
|
);
|
|
42368
42405
|
})
|
|
@@ -45811,6 +45848,32 @@ var enrichFiltersWithPackageAccoResults = function (results, tags) {
|
|
|
45811
45848
|
priceFilter.min = Math.floor(Math.min.apply(Math, prices));
|
|
45812
45849
|
priceFilter.max = Math.ceil(Math.max.apply(Math, prices));
|
|
45813
45850
|
filters.push(priceFilter);
|
|
45851
|
+
var starsFilter = {
|
|
45852
|
+
property: 'rating',
|
|
45853
|
+
label: 'Stars',
|
|
45854
|
+
type: 'star-rating',
|
|
45855
|
+
options: [],
|
|
45856
|
+
isFrontendFilter: true
|
|
45857
|
+
};
|
|
45858
|
+
var ratingMap = new Map();
|
|
45859
|
+
results.forEach(function (r) {
|
|
45860
|
+
var stars = r.stars;
|
|
45861
|
+
if (stars) {
|
|
45862
|
+
ratingMap.set(stars.toString(), {
|
|
45863
|
+
name: stars.toString(),
|
|
45864
|
+
value: stars
|
|
45865
|
+
});
|
|
45866
|
+
}
|
|
45867
|
+
});
|
|
45868
|
+
starsFilter.options = Array.from(ratingMap.values()).map(function (rating) {
|
|
45869
|
+
var _a;
|
|
45870
|
+
return {
|
|
45871
|
+
label: (_a = rating.name) !== null && _a !== void 0 ? _a : rating.value.toString(),
|
|
45872
|
+
value: rating.value,
|
|
45873
|
+
isChecked: false
|
|
45874
|
+
};
|
|
45875
|
+
});
|
|
45876
|
+
filters.push(starsFilter);
|
|
45814
45877
|
return filters;
|
|
45815
45878
|
};
|
|
45816
45879
|
var enrichFiltersWithPackageFlightResults = function (results, tags, translations) {
|
|
@@ -46123,6 +46186,12 @@ var applyFiltersToPackageAccoResults = function (results, filters, sortBy) {
|
|
|
46123
46186
|
if (filter.selectedMax != null && r.price > filter.selectedMax) return false;
|
|
46124
46187
|
return true;
|
|
46125
46188
|
}
|
|
46189
|
+
// RATING
|
|
46190
|
+
// if (filter.property === 'rating') {
|
|
46191
|
+
// if (r.stars == null) return false;
|
|
46192
|
+
// if (filter.selectedRating != null && r.stars < filter.selectedRating) return false;
|
|
46193
|
+
// return true;
|
|
46194
|
+
// }
|
|
46126
46195
|
return true;
|
|
46127
46196
|
});
|
|
46128
46197
|
});
|
package/build/build-esm/index.js
CHANGED
|
@@ -13887,7 +13887,8 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
13887
13887
|
|
|
13888
13888
|
var tideConnection = {
|
|
13889
13889
|
// host: 'https://localhost:44341',
|
|
13890
|
-
host: 'https://preview-tide.tidesoftware.be',
|
|
13890
|
+
// host: 'https://preview-tide.tidesoftware.be',
|
|
13891
|
+
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
13891
13892
|
apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
|
|
13892
13893
|
catalogueIds: [1],
|
|
13893
13894
|
officeId: 1
|
|
@@ -42017,6 +42018,13 @@ var Filters = function (_a) {
|
|
|
42017
42018
|
});
|
|
42018
42019
|
setFilters(updated);
|
|
42019
42020
|
};
|
|
42021
|
+
var handleStarRatingFilter = function (filter, rating) {
|
|
42022
|
+
var updated = filters.map(function (f) {
|
|
42023
|
+
if (f.property !== filter.property) return f;
|
|
42024
|
+
return __assign(__assign({}, f), { selectedRating: f.selectedRating === rating ? 0 : rating });
|
|
42025
|
+
});
|
|
42026
|
+
setFilters(updated);
|
|
42027
|
+
};
|
|
42020
42028
|
var handleSliderChange = function (filter, newMin, newMax) {
|
|
42021
42029
|
var updated = filters.map(function (f) {
|
|
42022
42030
|
if (f.property !== filter.property) return f;
|
|
@@ -42193,6 +42201,35 @@ var Filters = function (_a) {
|
|
|
42193
42201
|
handleSliderChange(filter, newMin, newMax);
|
|
42194
42202
|
}
|
|
42195
42203
|
});
|
|
42204
|
+
})(),
|
|
42205
|
+
isVisible &&
|
|
42206
|
+
filter.property === 'rating' &&
|
|
42207
|
+
filter.type === 'star-rating' &&
|
|
42208
|
+
(function () {
|
|
42209
|
+
var _a;
|
|
42210
|
+
var selectedRating = (_a = filter.selectedRating) !== null && _a !== void 0 ? _a : 0;
|
|
42211
|
+
return React__default.createElement(
|
|
42212
|
+
'div',
|
|
42213
|
+
{ className: 'search__filter-row star-rating-filter' },
|
|
42214
|
+
[5, 4, 3, 2, 1].map(function (star) {
|
|
42215
|
+
return React__default.createElement(
|
|
42216
|
+
'span',
|
|
42217
|
+
{
|
|
42218
|
+
key: star,
|
|
42219
|
+
className: 'star '.concat(star <= selectedRating ? 'filled' : ''),
|
|
42220
|
+
onClick: function () {
|
|
42221
|
+
return handleStarRatingFilter(filter, star);
|
|
42222
|
+
},
|
|
42223
|
+
role: 'button',
|
|
42224
|
+
tabIndex: 0,
|
|
42225
|
+
onKeyDown: function (e) {
|
|
42226
|
+
if (e.key === 'Enter' || e.key === ' ') handleStarRatingFilter(filter, star);
|
|
42227
|
+
}
|
|
42228
|
+
},
|
|
42229
|
+
'\u2605'
|
|
42230
|
+
);
|
|
42231
|
+
})
|
|
42232
|
+
);
|
|
42196
42233
|
})()
|
|
42197
42234
|
);
|
|
42198
42235
|
})
|
|
@@ -45588,6 +45625,32 @@ var enrichFiltersWithPackageAccoResults = function (results, tags) {
|
|
|
45588
45625
|
priceFilter.min = Math.floor(Math.min.apply(Math, prices));
|
|
45589
45626
|
priceFilter.max = Math.ceil(Math.max.apply(Math, prices));
|
|
45590
45627
|
filters.push(priceFilter);
|
|
45628
|
+
var starsFilter = {
|
|
45629
|
+
property: 'rating',
|
|
45630
|
+
label: 'Stars',
|
|
45631
|
+
type: 'star-rating',
|
|
45632
|
+
options: [],
|
|
45633
|
+
isFrontendFilter: true
|
|
45634
|
+
};
|
|
45635
|
+
var ratingMap = new Map();
|
|
45636
|
+
results.forEach(function (r) {
|
|
45637
|
+
var stars = r.stars;
|
|
45638
|
+
if (stars) {
|
|
45639
|
+
ratingMap.set(stars.toString(), {
|
|
45640
|
+
name: stars.toString(),
|
|
45641
|
+
value: stars
|
|
45642
|
+
});
|
|
45643
|
+
}
|
|
45644
|
+
});
|
|
45645
|
+
starsFilter.options = Array.from(ratingMap.values()).map(function (rating) {
|
|
45646
|
+
var _a;
|
|
45647
|
+
return {
|
|
45648
|
+
label: (_a = rating.name) !== null && _a !== void 0 ? _a : rating.value.toString(),
|
|
45649
|
+
value: rating.value,
|
|
45650
|
+
isChecked: false
|
|
45651
|
+
};
|
|
45652
|
+
});
|
|
45653
|
+
filters.push(starsFilter);
|
|
45591
45654
|
return filters;
|
|
45592
45655
|
};
|
|
45593
45656
|
var enrichFiltersWithPackageFlightResults = function (results, tags, translations) {
|
|
@@ -45900,6 +45963,12 @@ var applyFiltersToPackageAccoResults = function (results, filters, sortBy) {
|
|
|
45900
45963
|
if (filter.selectedMax != null && r.price > filter.selectedMax) return false;
|
|
45901
45964
|
return true;
|
|
45902
45965
|
}
|
|
45966
|
+
// RATING
|
|
45967
|
+
// if (filter.property === 'rating') {
|
|
45968
|
+
// if (r.stars == null) return false;
|
|
45969
|
+
// if (filter.selectedRating != null && r.stars < filter.selectedRating) return false;
|
|
45970
|
+
// return true;
|
|
45971
|
+
// }
|
|
45903
45972
|
return true;
|
|
45904
45973
|
});
|
|
45905
45974
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qite/tide-booking-component",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.123",
|
|
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.
|
|
32
|
+
"@qite/tide-client": "^1.1.178",
|
|
33
33
|
"@reduxjs/toolkit": "^2.8.2",
|
|
34
34
|
"@rollup/plugin-commonjs": "^19.0.1",
|
|
35
35
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -46,6 +46,19 @@ const Filters: React.FC<FiltersProps> = ({ initialFilters, filters, isOpen, hand
|
|
|
46
46
|
setFilters(updated);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
const handleStarRatingFilter = (filter: Filter, rating: number) => {
|
|
50
|
+
const updated = filters.map((f) => {
|
|
51
|
+
if (f.property !== filter.property) return f;
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
...f,
|
|
55
|
+
selectedRating: f.selectedRating === rating ? 0 : rating
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
setFilters(updated);
|
|
60
|
+
};
|
|
61
|
+
|
|
49
62
|
const handleSliderChange = (filter: Filter, newMin: number, newMax: number) => {
|
|
50
63
|
const updated = filters.map((f) => {
|
|
51
64
|
if (f.property !== filter.property) return f;
|
|
@@ -179,42 +192,29 @@ const Filters: React.FC<FiltersProps> = ({ initialFilters, filters, isOpen, hand
|
|
|
179
192
|
);
|
|
180
193
|
})()}
|
|
181
194
|
|
|
182
|
-
{
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
className={`star ${star <= selectedRating ? 'filled' : ''}`}
|
|
206
|
-
onClick={() => handleRatingChange(star)}
|
|
207
|
-
role="button"
|
|
208
|
-
tabIndex={0}
|
|
209
|
-
onKeyDown={(e) => {
|
|
210
|
-
if (e.key === 'Enter' || e.key === ' ') handleRatingChange(star);
|
|
211
|
-
}}>
|
|
212
|
-
★
|
|
213
|
-
</span>
|
|
214
|
-
))}
|
|
215
|
-
</div>
|
|
216
|
-
);
|
|
217
|
-
})()} */}
|
|
195
|
+
{isVisible &&
|
|
196
|
+
filter.property === 'rating' &&
|
|
197
|
+
filter.type === 'star-rating' &&
|
|
198
|
+
(() => {
|
|
199
|
+
const selectedRating = filter.selectedRating ?? 0;
|
|
200
|
+
return (
|
|
201
|
+
<div className="search__filter-row star-rating-filter">
|
|
202
|
+
{[5, 4, 3, 2, 1].map((star) => (
|
|
203
|
+
<span
|
|
204
|
+
key={star}
|
|
205
|
+
className={`star ${star <= selectedRating ? 'filled' : ''}`}
|
|
206
|
+
onClick={() => handleStarRatingFilter(filter, star)}
|
|
207
|
+
role="button"
|
|
208
|
+
tabIndex={0}
|
|
209
|
+
onKeyDown={(e) => {
|
|
210
|
+
if (e.key === 'Enter' || e.key === ' ') handleStarRatingFilter(filter, star);
|
|
211
|
+
}}>
|
|
212
|
+
★
|
|
213
|
+
</span>
|
|
214
|
+
))}
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
})()}
|
|
218
218
|
</div>
|
|
219
219
|
);
|
|
220
220
|
})}
|
|
@@ -132,6 +132,33 @@ export const enrichFiltersWithPackageAccoResults = (results: PackagingAccommodat
|
|
|
132
132
|
|
|
133
133
|
filters.push(priceFilter);
|
|
134
134
|
|
|
135
|
+
const starsFilter: Filter = {
|
|
136
|
+
property: 'rating',
|
|
137
|
+
label: 'Stars',
|
|
138
|
+
type: 'star-rating',
|
|
139
|
+
options: [],
|
|
140
|
+
isFrontendFilter: true
|
|
141
|
+
};
|
|
142
|
+
const ratingMap = new Map<string, { name?: string; value: number }>();
|
|
143
|
+
|
|
144
|
+
results.forEach((r) => {
|
|
145
|
+
const stars = r.stars;
|
|
146
|
+
if (stars) {
|
|
147
|
+
ratingMap.set(stars.toString(), {
|
|
148
|
+
name: stars.toString(),
|
|
149
|
+
value: stars
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
starsFilter.options = Array.from(ratingMap.values()).map((rating) => ({
|
|
155
|
+
label: rating.name ?? rating.value.toString(),
|
|
156
|
+
value: rating.value,
|
|
157
|
+
isChecked: false
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
filters.push(starsFilter);
|
|
161
|
+
|
|
135
162
|
return filters;
|
|
136
163
|
};
|
|
137
164
|
|
|
@@ -396,6 +423,14 @@ export const applyFiltersToPackageAccoResults = (results: PackagingAccommodation
|
|
|
396
423
|
return true;
|
|
397
424
|
}
|
|
398
425
|
|
|
426
|
+
// RATING
|
|
427
|
+
// if (filter.property === 'rating') {
|
|
428
|
+
// if (r.stars == null) return false;
|
|
429
|
+
// if (filter.selectedRating != null && r.stars < filter.selectedRating) return false;
|
|
430
|
+
|
|
431
|
+
// return true;
|
|
432
|
+
// }
|
|
433
|
+
|
|
399
434
|
return true;
|
|
400
435
|
});
|
|
401
436
|
});
|
|
@@ -4,7 +4,8 @@ import { ApiSettingsState } from '../types';
|
|
|
4
4
|
|
|
5
5
|
export const tideConnection = {
|
|
6
6
|
// host: 'https://localhost:44341',
|
|
7
|
-
host: 'https://preview-tide.tidesoftware.be',
|
|
7
|
+
// host: 'https://preview-tide.tidesoftware.be',
|
|
8
|
+
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
8
9
|
apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
|
|
9
10
|
catalogueIds: [1],
|
|
10
11
|
officeId: 1
|