ublo-lib 1.38.15 → 1.38.16
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/es/future/components/msem-preset-editor/components/stay-picker.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/components/stay-picker.js +1 -1
- package/es/future/components/msem-preset-editor/components/stay-picker.module.css +4 -0
- package/es/future/components/msem-preset-editor/components/widget-list-item.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/components/widget-list-item.js +37 -24
- package/es/future/components/msem-preset-editor/components/widget-list-item.module.css +43 -28
- package/es/future/components/msem-preset-editor/components/widget-list.module.css +4 -3
- package/es/future/components/msem-preset-editor/editors/lodgings.js +1 -1
- package/es/future/components/msem-preset-editor/msem-preset-editor.module.css +0 -1
- package/es/future/components/msem-preset-linker/msem-preset-linker.module.css +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stay-picker.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/stay-picker.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,OAAO,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"stay-picker.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/stay-picker.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,OAAO,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,2CAmD1D"}
|
|
@@ -31,5 +31,5 @@ export default function StayPicker({ stay, setStay }) {
|
|
|
31
31
|
}
|
|
32
32
|
setStay({ ...stay, [key]: value });
|
|
33
33
|
};
|
|
34
|
-
return (_jsxs("div", { className: css.picker, children: [_jsx(Input, { type: "date", label: "Date de d\u00E9but", value: stay.from, onValueChange: updateStay("from") }), _jsx(Input, { type: "date", label: "Date de fin", value: stay.to, onValueChange: updateStay("to") })] }));
|
|
34
|
+
return (_jsxs("div", { className: css.picker, children: [_jsx(Input, { className: css.input, type: "date", label: "Date de d\u00E9but", value: stay.from, onValueChange: updateStay("from") }), _jsx(Input, { className: css.input, type: "date", label: "Date de fin", value: stay.to, onValueChange: updateStay("to") })] }));
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-list-item.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/widget-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"widget-list-item.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/widget-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACpE,CAAC;AAWF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,EAAE,KAAK,2CAwKP"}
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import Button from "dt-design-system/es/button";
|
|
5
5
|
import Tooltip from "dt-design-system/es/tooltip";
|
|
6
|
+
import Dropdown from "dt-design-system/es/dropdown";
|
|
6
7
|
import * as Icons from "dt-design-system/es/icons";
|
|
7
8
|
import css from "./widget-list-item.module.css";
|
|
8
9
|
const ALLOW_PRESETS_ON_WIDGETS = [
|
|
@@ -16,42 +17,54 @@ const ALLOW_PRESETS_ON_WIDGETS = [
|
|
|
16
17
|
export default function WidgetListItem({ item, preset, updatePreset, removePreset, setShowPresetDialog, }) {
|
|
17
18
|
const [opened, setOpened] = React.useState(false);
|
|
18
19
|
const { widget, logo, name, items: subs } = item;
|
|
19
|
-
const toggleItem = () => {
|
|
20
|
-
setOpened(!opened);
|
|
21
|
-
};
|
|
22
20
|
const ToggleIcon = opened ? Icons.ChevronUp : Icons.ChevronDown;
|
|
23
21
|
const isSelected = preset?.name === name && preset?.widget === widget;
|
|
24
22
|
const hasSubs = subs && subs.length > 0;
|
|
25
23
|
const allowAdvancedPresets = ALLOW_PRESETS_ON_WIDGETS.includes(widget);
|
|
26
24
|
const showEditButton = isSelected && allowAdvancedPresets;
|
|
27
25
|
const showRemoveButton = isSelected;
|
|
26
|
+
const openDropdown = () => {
|
|
27
|
+
if (opened)
|
|
28
|
+
return;
|
|
29
|
+
setOpened(true);
|
|
30
|
+
};
|
|
31
|
+
const closeDropdown = () => {
|
|
32
|
+
setOpened(false);
|
|
33
|
+
};
|
|
34
|
+
const handleDropdownChildrenClick = (e) => {
|
|
35
|
+
const target = e.target;
|
|
36
|
+
const button = target.closest("button");
|
|
37
|
+
if (!button)
|
|
38
|
+
return;
|
|
39
|
+
closeDropdown();
|
|
40
|
+
};
|
|
28
41
|
const classes = classNames(css.item, {
|
|
29
42
|
[css.selected]: isSelected,
|
|
30
43
|
[css.opened]: opened,
|
|
31
44
|
});
|
|
32
45
|
const handleItemClick = () => {
|
|
33
|
-
if (!isSelected) {
|
|
46
|
+
if (widget && !isSelected) {
|
|
34
47
|
updatePreset(item);
|
|
35
48
|
}
|
|
36
49
|
};
|
|
37
|
-
return (_jsxs("div", { className: classes, children: [_jsxs(Button, { variant: "transparent", className: css.button, onClick: handleItemClick, children: [_jsx("div", { className: css.logo, children: _jsx("img", { src: logo, alt: name }) }), _jsx("div", { className: css.name, children: name })] }), (hasSubs || showEditButton || showRemoveButton) && (_jsxs("div", { className: css.actions, children: [showEditButton && (_jsx(Tooltip, { content: "
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
return (_jsxs("div", { className: classes, children: [_jsxs(Button, { variant: "transparent", className: css.button, onClick: handleItemClick, disabled: !widget, children: [_jsx("div", { className: css.logo, children: _jsx("img", { src: logo, alt: name }) }), _jsx("div", { className: css.name, children: name })] }), (hasSubs || showEditButton || showRemoveButton) && (_jsxs("div", { className: css.actions, children: [showEditButton && (_jsx(Tooltip, { content: "Affiner le preset", children: _jsx(Button, { variant: "primary", className: css.action, onClick: () => setShowPresetDialog(true), compact: true, children: _jsx(Icons.Edit, {}) }) })), showRemoveButton && (_jsx(Tooltip, { content: "Supprimer le preset", children: _jsx(Button, { variant: "danger", className: css.action, onClick: removePreset, compact: true, children: _jsx(Icons.Trash, {}) }) })), hasSubs && (_jsx(Dropdown, { breakpoint: 600, onClose: closeDropdown, open: opened, className: css.dropdown, title: "Marchands", content: _jsx("div", { className: css.list, children: subs.map((sub) => {
|
|
51
|
+
const isSelected = preset?.name === sub.name;
|
|
52
|
+
const allowedWidgets = [
|
|
53
|
+
"otherProducts",
|
|
54
|
+
...ALLOW_PRESETS_ON_WIDGETS,
|
|
55
|
+
];
|
|
56
|
+
const isSkiRental = widget === "skiRental";
|
|
57
|
+
const allowAdvancedPresets = !isSkiRental && allowedWidgets.includes(sub.widget);
|
|
58
|
+
const showEditButton = isSelected && allowAdvancedPresets;
|
|
59
|
+
const showButtons = showEditButton || isSelected;
|
|
60
|
+
const classes = classNames(css.sub, {
|
|
61
|
+
[css.subSelected]: isSelected,
|
|
62
|
+
});
|
|
63
|
+
const handleSubClick = () => {
|
|
64
|
+
if (!isSelected) {
|
|
65
|
+
updatePreset(item, sub);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return (_jsxs("div", { className: classes, children: [_jsx(Button, { variant: "transparent", className: css.subButton, onClick: handleSubClick, autoFocus: isSelected ? true : undefined, children: sub.name }), showButtons && (_jsxs("div", { className: css.subActions, children: [showEditButton && (_jsx(Tooltip, { content: "Affiner le preset", children: _jsx(Button, { variant: "primary", className: css.action, onClick: () => setShowPresetDialog(true), compact: true, children: _jsx(Icons.Edit, {}) }) })), isSelected && (_jsx(Tooltip, { content: "Supprimer le preset", children: _jsx(Button, { variant: "danger", className: css.action, onClick: removePreset, compact: true, children: _jsx(Icons.Trash, {}) }) }))] }))] }, sub.name));
|
|
69
|
+
}) }), children: _jsx(Button, { variant: "secondary", className: css.action, onClick: openDropdown, compact: true, children: _jsx(ToggleIcon, {}) }) }))] }))] }));
|
|
57
70
|
}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
.item {
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
|
-
|
|
4
|
+
justify-content: center;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.button {
|
|
8
8
|
width: 100%;
|
|
9
|
-
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
10
13
|
gap: 10px;
|
|
11
|
-
|
|
12
|
-
text-align: left;
|
|
13
|
-
padding-right: 100px;
|
|
14
|
+
padding-bottom: 35px;
|
|
14
15
|
background-color: var(--ublo-grey-000, #ffffff);
|
|
16
|
+
border: 1px solid var(--ublo-grey-200, #ededed);
|
|
15
17
|
border-radius: var(--ublo-radius-200, 8px);
|
|
16
18
|
transition: 160ms background-color
|
|
17
19
|
var(--ublo-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
.button:disabled {
|
|
23
|
+
filter: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
.selected .button,
|
|
21
27
|
.selected .button:hover {
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
background: var(
|
|
29
|
+
--ublo-blue-gradient,
|
|
30
|
+
linear-gradient(
|
|
31
|
+
175deg,
|
|
32
|
+
var(--ublo-blue-400, #4177f6),
|
|
33
|
+
var(--ublo-blue-500, #004cc2)
|
|
34
|
+
)
|
|
35
|
+
);
|
|
24
36
|
}
|
|
25
37
|
|
|
26
|
-
.item:not(.selected) .button:hover {
|
|
38
|
+
.item:not(.selected) .button:not(:disabled):hover {
|
|
27
39
|
background-color: var(--ublo-grey-100, #f5f5f5);
|
|
28
40
|
}
|
|
29
41
|
|
|
@@ -38,21 +50,13 @@
|
|
|
38
50
|
display: flex;
|
|
39
51
|
align-items: center;
|
|
40
52
|
justify-content: center;
|
|
41
|
-
background: var(
|
|
42
|
-
--ublo-blue-gradient,
|
|
43
|
-
linear-gradient(
|
|
44
|
-
175deg,
|
|
45
|
-
var(--ublo-blue-400, #4177f6),
|
|
46
|
-
var(--ublo-blue-500, #004cc2)
|
|
47
|
-
)
|
|
48
|
-
);
|
|
53
|
+
background-color: var(--ublo-grey-200, #ededed);
|
|
49
54
|
border-radius: var(--ublo-radius-200, 8px);
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
.logo img {
|
|
53
58
|
width: 24px;
|
|
54
59
|
height: 24px;
|
|
55
|
-
filter: brightness(0) invert(1);
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
.name {
|
|
@@ -60,29 +64,32 @@
|
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
.selected .name {
|
|
63
|
-
color: var(--ublo-
|
|
67
|
+
color: var(--ublo-grey-000, #ffffff);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
.actions {
|
|
67
71
|
position: absolute;
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
bottom: 10px;
|
|
73
|
+
left: 50%;
|
|
70
74
|
display: flex;
|
|
71
75
|
gap: 4px;
|
|
76
|
+
transform: translateX(-50%);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
.action {
|
|
75
80
|
border-radius: var(--ublo-radius-100, 3px);
|
|
76
81
|
}
|
|
77
82
|
|
|
83
|
+
.dropdown {
|
|
84
|
+
padding: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
78
87
|
.list {
|
|
79
|
-
|
|
80
|
-
max-height: 140px;
|
|
88
|
+
max-height: 40vh;
|
|
81
89
|
display: flex;
|
|
82
90
|
flex-direction: column;
|
|
83
|
-
|
|
84
|
-
padding:
|
|
85
|
-
border-left: 3px solid var(--ublo-grey-200, #ededed);
|
|
91
|
+
gap: 4px;
|
|
92
|
+
padding: 6px;
|
|
86
93
|
overflow: auto;
|
|
87
94
|
overscroll-behavior: contain;
|
|
88
95
|
scrollbar-width: thin;
|
|
@@ -115,13 +122,21 @@
|
|
|
115
122
|
|
|
116
123
|
.subSelected .subButton,
|
|
117
124
|
.subSelected .subButton:hover {
|
|
118
|
-
color: var(--ublo-
|
|
119
|
-
background
|
|
125
|
+
color: var(--ublo-grey-000, #ffffff);
|
|
126
|
+
background: var(
|
|
127
|
+
--ublo-blue-gradient,
|
|
128
|
+
linear-gradient(
|
|
129
|
+
175deg,
|
|
130
|
+
var(--ublo-blue-400, #4177f6),
|
|
131
|
+
var(--ublo-blue-500, #004cc2)
|
|
132
|
+
)
|
|
133
|
+
);
|
|
120
134
|
}
|
|
121
135
|
|
|
122
|
-
.
|
|
136
|
+
.sub:not(.subSelected) .subButton:hover {
|
|
123
137
|
background-color: var(--ublo-grey-100, #f5f5f5);
|
|
124
138
|
}
|
|
139
|
+
|
|
125
140
|
.subActions {
|
|
126
141
|
position: absolute;
|
|
127
142
|
top: 50%;
|
|
@@ -171,7 +171,7 @@ export default function Lodgings({ msemServicesUrl, preset, setPreset, setShowPr
|
|
|
171
171
|
return newPreset;
|
|
172
172
|
});
|
|
173
173
|
}, [data, onChange, urlOverride, setPreset]);
|
|
174
|
-
return (_jsxs(Form, { title: "Presets h\u00E9bergements", width: 580, preset: preset, buttonsActions: { testPreset, cancelPreset, confirmPreset }, 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: formattedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formattedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomType, options: formattedRooms, onValueChange: updateField("roomType"), loading: loading })), _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" }), lodgings && (_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateFilter("merchants"), loading: loading, withSearch: true })), (loading || kinds.length > 1) && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), (loading || filters.standings.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Standing", options: filters.standings, values: selectedStandings, onChange: updateFilter("standings"), loading: loading, withSearch: true })), (loading || filters.options.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading, withSearch: true })), (loading || filters.districts.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Quartiers", options: filters.districts, values: selectedDistricts, onChange: updateFilter("districts"), loading: loading, withSearch: true }))
|
|
174
|
+
return (_jsxs(Form, { title: "Presets h\u00E9bergements", width: 580, preset: preset, buttonsActions: { testPreset, cancelPreset, confirmPreset }, 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: formattedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formattedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomType, options: formattedRooms, onValueChange: updateField("roomType"), loading: loading })), _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" }), lodgings && (_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateFilter("merchants"), loading: loading, withSearch: true })), (loading || kinds.length > 1) && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), (loading || filters.standings.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Standing", options: filters.standings, values: selectedStandings, onChange: updateFilter("standings"), loading: loading, withSearch: true })), (loading || filters.options.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading, withSearch: true })), (loading || filters.districts.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Quartiers", options: filters.districts, values: selectedDistricts, onChange: updateFilter("districts"), loading: loading, withSearch: true })), _jsx("div", { className: css.label, children: "Avanc\u00E9" }), _jsx(Input, { className: css.input, label: "Filtre", value: data.filter, placeholder: "('10', '22') in options", onValueChange: updateField("filter") })] }))] }));
|
|
175
175
|
}
|
|
176
176
|
function getDefaultData(preset) {
|
|
177
177
|
if (!preset?.presets && !preset?.options)
|