ublo-lib 1.19.15 → 1.19.17
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.
|
@@ -52,7 +52,9 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
52
52
|
label: room.title,
|
|
53
53
|
value: room.type,
|
|
54
54
|
}));
|
|
55
|
-
const selectedStandings = data.standings?.map((standing) =>
|
|
55
|
+
// const selectedStandings = data.standings?.map((standing) =>
|
|
56
|
+
// filters?.standings?.find((d) => d.value === standing)
|
|
57
|
+
// );
|
|
56
58
|
const selectedOptions = data.options?.map((option) => filters?.options?.find((d) => d.value === option));
|
|
57
59
|
const selectedDistricts = data.districts?.map((district) => filters?.districts?.find((d) => d.value === district));
|
|
58
60
|
const cancelPreset = () => {
|
|
@@ -128,7 +130,7 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
128
130
|
setData((data) => ({
|
|
129
131
|
...data,
|
|
130
132
|
openPage: data.openPage ?? true,
|
|
131
|
-
standings: DEFAULT_DATA.standings,
|
|
133
|
+
// standings: DEFAULT_DATA.standings,
|
|
132
134
|
options: DEFAULT_DATA.options,
|
|
133
135
|
districts: DEFAULT_DATA.districts,
|
|
134
136
|
type: DEFAULT_DATA.type,
|
|
@@ -146,7 +148,7 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
146
148
|
const openPage = lodging ? data.openPage : undefined;
|
|
147
149
|
const agesChildren = [...new Array(children)].map((_) => 12);
|
|
148
150
|
const paxPlan = adults ? { adults, children, agesChildren } : undefined;
|
|
149
|
-
const standings = data.standings?.length ? data.standings : undefined;
|
|
151
|
+
// const standings = data.standings?.length ? data.standings : undefined;
|
|
150
152
|
const options = data.options?.length ? data.options : undefined;
|
|
151
153
|
const districts = data.districts?.length ? data.districts : undefined;
|
|
152
154
|
const type = data.type || undefined;
|
|
@@ -155,7 +157,7 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
155
157
|
const previewDetails = { paxPlan, roomType };
|
|
156
158
|
const presets = {
|
|
157
159
|
accomodation,
|
|
158
|
-
standings,
|
|
160
|
+
// standings,
|
|
159
161
|
options,
|
|
160
162
|
districts,
|
|
161
163
|
nbRooms,
|
|
@@ -176,12 +178,12 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
176
178
|
testPreset,
|
|
177
179
|
cancelPreset,
|
|
178
180
|
confirmPreset,
|
|
179
|
-
}, children: [_jsx("div", { className: css.label, children: "Nombre de personnes" }), _jsxs("div", { className: css.row, children: [_jsx(NumberPicker, { className: css.peopleInput, label: "Adultes", min: 0, max: 20, value: data.adults, onChange: updateField("adults"), withInput: true }), _jsx(NumberPicker, { className: css.peopleInput, label: "Enfants", min: 0, max: 9, value: data.children, onChange: updateField("children"), withInput: true })] }), _jsx("div", { className: css.label, children: "H\u00E9bergement" }), _jsx(Select, { placeholder: "S\u00E9lectionnez un h\u00E9bergement", options: formatedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), showLodgingPageCheckbox && (_jsx(Checkbox, { label: "Ouvrir la page du site", checked: data.openPage, disabled: !showLodgingPageCheckbox, onCheckedChange: updateField("openPage") })), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formatedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomType, options: formatedRooms, loading: loading, onValueChange: updateField("roomType") })), _jsx(NumberPicker, { label: "Nombre de chambres", min: 0, max: 20, value: data.nbRooms?.[0] || 0, onChange: updateRoomNb, withInput: true })] })), showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Filtres" }), kinds.length > 1 && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), filters?.
|
|
181
|
+
}, children: [_jsx("div", { className: css.label, children: "Nombre de personnes" }), _jsxs("div", { className: css.row, children: [_jsx(NumberPicker, { className: css.peopleInput, label: "Adultes", min: 0, max: 20, value: data.adults, onChange: updateField("adults"), withInput: true }), _jsx(NumberPicker, { className: css.peopleInput, label: "Enfants", min: 0, max: 9, value: data.children, onChange: updateField("children"), withInput: true })] }), _jsx("div", { className: css.label, children: "H\u00E9bergement" }), _jsx(Select, { placeholder: "S\u00E9lectionnez un h\u00E9bergement", options: formatedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), showLodgingPageCheckbox && (_jsx(Checkbox, { label: "Ouvrir la page du site", checked: data.openPage, disabled: !showLodgingPageCheckbox, onCheckedChange: updateField("openPage") })), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formatedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomType, options: formatedRooms, loading: loading, onValueChange: updateField("roomType") })), _jsx(NumberPicker, { label: "Nombre de chambres", min: 0, max: 20, value: data.nbRooms?.[0] || 0, onChange: updateRoomNb, withInput: true })] })), showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Filtres" }), kinds.length > 1 && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), filters?.options && filters?.options?.length > 1 && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading })), filters?.districts && filters?.districts?.length > 1 && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Quartiers", options: filters.districts, values: selectedDistricts, onChange: updateFilter("districts"), loading: loading }))] }))] }));
|
|
180
182
|
}
|
|
181
183
|
function getDefaultData(preset) {
|
|
182
184
|
if (!preset?.presets && !preset?.options)
|
|
183
185
|
return DEFAULT_DATA;
|
|
184
|
-
const { accomodation, nbRooms, standings, options, districts, type } = preset?.presets || {};
|
|
186
|
+
const { accomodation, nbRooms, /* standings, */ options, districts, type } = preset?.presets || {};
|
|
185
187
|
const { openPage } = preset;
|
|
186
188
|
const { paxPlan, roomType } = preset?.options?.previewDetails || {};
|
|
187
189
|
return {
|
|
@@ -190,7 +192,7 @@ function getDefaultData(preset) {
|
|
|
190
192
|
lodging: accomodation || DEFAULT_DATA.lodging,
|
|
191
193
|
nbRooms: nbRooms || DEFAULT_DATA.nbRooms,
|
|
192
194
|
roomType: roomType || DEFAULT_DATA.roomType,
|
|
193
|
-
standings: standings || DEFAULT_DATA.standings,
|
|
195
|
+
// standings: standings || DEFAULT_DATA.standings,
|
|
194
196
|
options: options || DEFAULT_DATA.options,
|
|
195
197
|
districts: districts || DEFAULT_DATA.districts,
|
|
196
198
|
type: type || DEFAULT_DATA.type,
|