imio.smartweb.core 1.2.47__py3-none-any.whl → 1.2.48__py3-none-any.whl

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.
Files changed (72) hide show
  1. imio/smartweb/core/contents/sections/events/view.py +2 -1
  2. imio/smartweb/core/contents/sections/news/view.py +2 -1
  3. imio/smartweb/core/contents/sections/text/views.py +2 -0
  4. imio/smartweb/core/contents/sections/views.py +2 -0
  5. imio/smartweb/core/tests/resources/json_rest_events.json +4 -1
  6. imio/smartweb/core/tests/test_rest.py +4 -1
  7. imio/smartweb/core/tests/test_section_events.py +9 -8
  8. imio/smartweb/core/tests/test_section_news.py +6 -6
  9. imio/smartweb/core/tests/test_vocabularies.py +2 -2
  10. imio/smartweb/core/utils.py +1 -1
  11. imio/smartweb/core/viewlets/footer.pt +5 -0
  12. imio/smartweb/core/viewlets/footer.py +5 -0
  13. imio/smartweb/core/vocabularies.py +2 -2
  14. imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
  15. imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
  16. imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
  17. imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
  18. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
  19. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +5 -0
  20. imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +1 -1
  21. imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
  22. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js +1 -1
  23. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -3
  24. imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
  25. imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
  26. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
  27. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +101 -74
  28. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +4 -22
  29. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +22 -18
  30. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +4 -2
  31. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +7 -2
  32. imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +211 -98
  33. imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +506 -378
  34. imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +13 -4
  35. imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +117 -82
  36. imio/smartweb/core/webcomponents/src/components/Events/Events.scss +52 -28
  37. imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +257 -90
  38. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -54
  39. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +60 -12
  40. imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
  41. imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +217 -0
  42. imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
  43. imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
  44. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
  45. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
  46. imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +127 -82
  47. imio/smartweb/core/webcomponents/src/components/News/News.jsx +86 -53
  48. imio/smartweb/core/webcomponents/src/components/News/News.scss +29 -9
  49. imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +34 -31
  50. imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +264 -244
  51. imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +13 -8
  52. imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +23 -12
  53. imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +23 -12
  54. imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +5 -5
  55. imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
  56. imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +4 -4
  57. imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +13 -4
  58. imio/smartweb/core/webcomponents/src/index.jsx +3 -3
  59. imio/smartweb/core/webcomponents/src/index.scss +11 -65
  60. imio/smartweb/core/webcomponents/src/utils/Map.jsx +18 -9
  61. imio/smartweb/core/webcomponents/src/utils/translation.js +18 -0
  62. imio.smartweb.core-1.2.48-py3.10-nspkg.pth +3 -0
  63. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/METADATA +22 -3
  64. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/RECORD +69 -63
  65. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/WHEEL +1 -1
  66. imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
  67. imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
  68. imio.smartweb.core-1.2.47-py3.8-nspkg.pth +0 -2
  69. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.GPL +0 -0
  70. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.rst +0 -0
  71. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/namespace_packages.txt +0 -0
  72. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/top_level.txt +0 -0
@@ -1,34 +1,68 @@
1
+ .schedul-Filter {
2
+ width: 100%;
3
+
4
+ @media screen and (min-width:630px) {
5
+ width: auto;
6
+ }
7
+ }
8
+
1
9
  .period-filter {
10
+ width: 100%;
11
+
12
+ @media screen and (min-width:630px) {
13
+ width: auto;
14
+ }
15
+
2
16
  .period-filter-toggler {
17
+ width: 100%;
18
+
19
+ @media screen and (min-width:630px) {
20
+ width: auto;
21
+ }
22
+
3
23
  &>button {
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ min-width: 150px;
4
28
  background: transparent;
5
29
  color: hsl(0, 0%, 20%);
6
30
  box-sizing: border-box;
7
31
  font-weight: bold;
8
- font-size: 12px;
9
- text-transform: uppercase;
10
- letter-spacing: 1.2px;
11
-
12
- -webkit-box-pack: justify;
13
- -webkit-justify-content: space-between;
14
- justify-content: space-between;
15
- min-height: 38px;
32
+ font-size: 14px;
33
+ letter-spacing: 1.4px;
34
+ text-align: left;
35
+ min-height: 30px;
16
36
  outline: 0 !important;
17
37
  position: relative;
18
38
  -webkit-transition: all 100ms;
19
39
  transition: all 100ms;
20
40
  background-color: white;
21
- border-color: hsl(0, 0%, 80%);
41
+ border-color: none;
22
42
  border-radius: 0;
23
- border-style: solid;
24
43
  border-width: 1px;
44
+ border: solid 1px #fff;
25
45
  box-sizing: border-box;
26
- height: 50px;
46
+ height: 40px;
47
+ border-radius: 10px;
48
+ width: 100%;
49
+
50
+ @media screen and (min-width:630px) {
51
+ width: auto;
52
+ }
53
+
54
+ @media screen and (max-width:629px) {
55
+ background-color: transparent;
56
+ border-color: hsl(0, 0%, 70%);
57
+ color: hsl(0, 0%, 20%);
58
+ border: solid 1px #CFCFCF;
59
+ }
27
60
 
28
61
  &:hover {
29
62
  background-color: transparent;
30
63
  border-color: hsl(0, 0%, 70%);
31
64
  color: hsl(0, 0%, 20%);
65
+ border: solid 1px #CFCFCF;
32
66
  }
33
67
 
34
68
  &:focus,
@@ -36,7 +70,21 @@
36
70
  border-color: #2684FF !important;
37
71
  background: transparent !important;
38
72
  color: hsl(0, 0%, 20%) !important;
39
- box-shadow: 0 0 0 1px #2684FF !important;
73
+ box-shadow: 0 0 0 2px #2684FF !important;
74
+ }
75
+
76
+ &:after {
77
+ content: "";
78
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' width='20' viewBox='0 0 20 20' aria-hidden='true' focusable='false' fill='%23CFCFCF' class='css-tj5bde-Svg'%3E%3Cpath d='M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z'%3E%3C/path%3E%3C/svg%3E");
79
+ display: inline-block;
80
+ width: 20px;
81
+ height: 20px;
82
+ background-repeat: no-repeat;
83
+ border: inherit;
84
+ border-color: transparent;
85
+ background-position: center;
86
+ vertical-align: bottom;
87
+ margin-left: auto;
40
88
  }
41
89
  }
42
90
  }
@@ -0,0 +1,42 @@
1
+ export const iam = [
2
+ {
3
+ label: "Commerçant",
4
+ value: "merchant",
5
+ },
6
+ {
7
+ label: "Demandeur d'emploi",
8
+ value: "job_seeker",
9
+ },
10
+ {
11
+ label: "En situation de handicap",
12
+ value: "disabled_person",
13
+ },
14
+ {
15
+ label: "Jeune",
16
+ value: "young",
17
+ },
18
+ {
19
+ label: "Journaliste",
20
+ value: "journalist",
21
+ },
22
+ {
23
+ label: "Nouvel arrivant",
24
+ value: "newcomer",
25
+ },
26
+ {
27
+ label: "Organisateur d'événement",
28
+ value: "event_planner",
29
+ },
30
+ {
31
+ label: "Parent",
32
+ value: "parent",
33
+ },
34
+ {
35
+ label: "Senior",
36
+ value: "elder",
37
+ },
38
+ {
39
+ label: "Touriste",
40
+ value: "tourist",
41
+ },
42
+ ];
@@ -0,0 +1,217 @@
1
+ .r-result-filter-container {
2
+ @media screen and (min-width:1200px) {
3
+ position: sticky;
4
+ }
5
+
6
+ z-index: 1;
7
+ background: #fff;
8
+
9
+ .r-result-filter {
10
+ padding-top: 1rem;
11
+ padding-bottom: 1rem;
12
+ border-bottom: solid 1px #cccc;
13
+ }
14
+ }
15
+
16
+ .r-results-numbers {
17
+ width: 100%;
18
+ margin-bottom: 0rem;
19
+ padding-top: 1rem;
20
+
21
+ span {
22
+ font-weight: bold;
23
+ }
24
+ }
25
+
26
+
27
+
28
+ // react filter menu
29
+
30
+ .react-filters-menu {
31
+ display: flex;
32
+ width: 100%;
33
+ margin-bottom: 1rem;
34
+
35
+ .react-filters-container {
36
+ display: flex;
37
+ align-items: flex-start;
38
+ position: relative;
39
+ flex-direction: column;
40
+ width: auto;
41
+ border-radius: 30px;
42
+ gap: 10px;
43
+ background: #fff;
44
+ width: 100%;
45
+
46
+ @media screen and (min-width:630px) {
47
+ align-items: center;
48
+ flex-direction: row;
49
+ width: auto;
50
+ padding: 4px 15px;
51
+ border: solid 1px #CFCFCF;
52
+ box-shadow: 0 3px 12px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, .05);
53
+
54
+ }
55
+ }
56
+
57
+ .react-sep-menu {
58
+ display: none;
59
+ background: #CFCFCF;
60
+ width: 1px;
61
+ height: 20px;
62
+
63
+ @media screen and (min-width:630px) {
64
+ display: block;
65
+ }
66
+ }
67
+
68
+ span[class$="-indicatorSeparator"] {
69
+ display: none;
70
+ }
71
+
72
+ div[class$="-indicatorContainer"] {
73
+ padding: 0;
74
+ }
75
+
76
+ .accordion-collapse {
77
+ padding-top: 1rem;
78
+ }
79
+
80
+ .top-filter {
81
+ width: 100%;
82
+
83
+ @media screen and (min-width:630px) {
84
+ width: auto;
85
+ }
86
+
87
+ .select-custom-no-border {
88
+ width: 100%;
89
+
90
+ @media screen and (min-width:630px) {
91
+ width: auto;
92
+ }
93
+
94
+ div[class$="-control"] {
95
+ width: 100%;
96
+
97
+ @media screen and (max-width:629px) {
98
+ border-color: hsl(0, 0%, 70%);
99
+ color: hsl(0, 0%, 20%);
100
+ border: solid 1px #CFCFCF;
101
+ }
102
+
103
+ @media screen and (min-width:630px) {
104
+ width: auto;
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ // react search bar
112
+
113
+ .r-filter-search {
114
+ position: relative;
115
+ padding: 12px 6px;
116
+ border-radius: 50px;
117
+ display: block;
118
+ width: 100%;
119
+
120
+ @media screen and (max-width:629px) {
121
+ width: calc(100% - 40px);
122
+ border: solid 1px #CFCFCF;
123
+ box-shadow: 0 3px 12px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, .05);
124
+ }
125
+
126
+ @media screen and (min-width:630px) {
127
+ width: 175px;
128
+ }
129
+
130
+ input {
131
+ border: none;
132
+ width: 100%;
133
+
134
+ &:focus {
135
+ outline: none;
136
+ }
137
+ }
138
+
139
+ svg {
140
+ position: absolute;
141
+ transform: translateX(-100%);
142
+ right: 0;
143
+ }
144
+
145
+ .relative {
146
+ display: flex;
147
+ justify-content: center;
148
+ align-items: center;
149
+ }
150
+ }
151
+
152
+
153
+ // // More filters
154
+
155
+ .more-filter-btn {
156
+ background-color: transparent;
157
+ border: none;
158
+ position: absolute;
159
+ right: 0;
160
+ top: 18px;
161
+
162
+ @media screen and (min-width:630px) {
163
+ width: auto;
164
+ translate: 40px;
165
+ top: inherit;
166
+ }
167
+
168
+ &.collapsed {
169
+ transform: rotate(180deg);
170
+
171
+ svg {
172
+ stroke: #9f9f9f;
173
+ }
174
+ }
175
+ }
176
+
177
+ .more-filter-container {
178
+ &.collapse:not(.show) {
179
+ display: none;
180
+ }
181
+
182
+ .accordion-body {
183
+ display: flex;
184
+ gap: 20px;
185
+ align-items: center;
186
+ padding: 1rem;
187
+ background-color: #f8F8F8;
188
+ justify-content: center;
189
+ border: solid 1px #e4e4e4;
190
+ border-left: none;
191
+ border-right: none;
192
+
193
+ @media screen and (max-width:630px) {
194
+ display: flex;
195
+ flex-direction: column;
196
+ }
197
+ }
198
+
199
+ .free-Filter {
200
+ label {
201
+ font-size: 12px;
202
+ font-weight: bold;
203
+ letter-spacing: 1.4px;
204
+ }
205
+
206
+ .form-check {
207
+ display: flex;
208
+ align-items: center;
209
+ gap: 5px;
210
+ padding: 0;
211
+
212
+ input {
213
+ margin: 0;
214
+ }
215
+ }
216
+ }
217
+ }
@@ -0,0 +1,94 @@
1
+ export const taxonomy_event_public = [
2
+ {
3
+ label: "Petit enfant",
4
+ value: "i8gf49541q",
5
+ },
6
+ {
7
+ label: "Petit enfant » 1 an",
8
+ value: "tdtpdh546x",
9
+ },
10
+ {
11
+ label: "Petit enfant » 2 ans",
12
+ value: "19hb3u884v",
13
+ },
14
+ {
15
+ label: "Petit enfant » 3 ans",
16
+ value: "cl7oi9xaig",
17
+ },
18
+ {
19
+ label: "Enfant",
20
+ value: "omg40jn2yl",
21
+ },
22
+ {
23
+ label: "Enfant » 4 ans",
24
+ value: "a04ryxt74a",
25
+ },
26
+ {
27
+ label: "Enfant » 5 ans",
28
+ value: "2u0ugvi72u",
29
+ },
30
+ {
31
+ label: "Enfant » 6 ans",
32
+ value: "8btkbsp9ei",
33
+ },
34
+ {
35
+ label: "Enfant » 7 ans",
36
+ value: "gp881gyhmy",
37
+ },
38
+ {
39
+ label: "Enfant » 8 ans",
40
+ value: "me9vnw7vnk",
41
+ },
42
+ {
43
+ label: "Enfant » 9 ans",
44
+ value: "11ps76le1h",
45
+ },
46
+ {
47
+ label: "Enfant » 10 ans",
48
+ value: "rf2m1fbrot",
49
+ },
50
+ {
51
+ label: "Enfant » 11 ans",
52
+ value: "79qhii8mnf",
53
+ },
54
+ {
55
+ label: "Adolescent",
56
+ value: "ah0rbc2qr4",
57
+ },
58
+ {
59
+ label: "Adolescent » 12 ans",
60
+ value: "x6rmmxao6i",
61
+ },
62
+ {
63
+ label: "Adolescent » 13 ans",
64
+ value: "1pn83a9xkw",
65
+ },
66
+ {
67
+ label: "Adolescent » 14 ans",
68
+ value: "b8skpvhfka",
69
+ },
70
+ {
71
+ label: "Adolescent » 15 ans",
72
+ value: "snvxin8j4j",
73
+ },
74
+ {
75
+ label: "Adolescent » 16 ans",
76
+ value: "v4ty7v0hab",
77
+ },
78
+ {
79
+ label: "Adolescent » 17 ans",
80
+ value: "1x1ii6jxhu",
81
+ },
82
+ {
83
+ label: "Adulte",
84
+ value: "5lfbjyeea0",
85
+ },
86
+ {
87
+ label: "Plus de 60 ans",
88
+ value: "58cuuquwed",
89
+ },
90
+ {
91
+ label: "Tout public",
92
+ value: "ry275hefdy",
93
+ },
94
+ ];
@@ -0,0 +1,58 @@
1
+ export const menuStyles = {
2
+ control: (styles) => ({
3
+ ...styles,
4
+ backgroundColor: "white",
5
+ borderColor: "transparent",
6
+ borderRadius: "10px",
7
+ minWidth:"150px",
8
+ height: "40px",
9
+ }),
10
+ menu: (styles) => ({
11
+ ...styles,
12
+ width: "max-content",
13
+ maxWidth: "250px",
14
+ }),
15
+ placeholder: (styles) => ({
16
+ ...styles,
17
+ color: "000",
18
+ fontWeight: "bold",
19
+ fontSize: "14px",
20
+ letterSpacing: "1.4px",
21
+ }),
22
+ indicators: (styles) => ({
23
+ ...styles,
24
+ color: "blue",
25
+ }),
26
+ option: (styles) => {
27
+ return {
28
+ ...styles,
29
+ };
30
+ },
31
+ };
32
+
33
+ export const moreFilterStyles = {
34
+ control: (styles) => ({
35
+ ...styles,
36
+ backgroundColor: "white",
37
+ borderRadius: "10px",
38
+ height: "30px",
39
+ minWidth:"150px",
40
+ }),
41
+ placeholder: (styles) => ({
42
+ ...styles,
43
+ color: "000",
44
+ fontWeight: "bold",
45
+ fontSize: "12px",
46
+ letterSpacing: "1.4px",
47
+ }),
48
+ menu: (styles) => ({
49
+ ...styles,
50
+ width: "max-content",
51
+ maxWidth: "250px",
52
+ }),
53
+ option: (styles, { data, isDisabled, isFocused, isSelected }) => {
54
+ return {
55
+ ...styles,
56
+ };
57
+ },
58
+ };
@@ -0,0 +1,149 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import Select from "react-select";
3
+ import "./TaxonomyFilter.scss";
4
+
5
+ function TaxonomyFilter({ onChange, sub, title, token, isActive, setCat, onClick }) {
6
+ const [select1Value, setSelect1Value] = useState(null);
7
+ const [select2Value, setSelect2Value] = useState(null);
8
+ const [select3Value, setSelect3Value] = useState(null);
9
+ const [firstLevelOptions, setFirstLevelOptions] = useState(null);
10
+ const [secondLevelOptions, setSecondLevelOptions] = useState(null);
11
+ // État pour suivre l'affichage de la div associée
12
+ const [secondLevelVisible, setsecondLevelVisible] = useState(false);
13
+ const [thirdLevelVisible, setThirdLevelVisible] = useState(false);
14
+ // const avev la valeur des filtres
15
+ const [filterValue, setFilterValue] = useState({
16
+ taxonomy_contact_category_for_filtering: null,
17
+ });
18
+
19
+ // Object { b_start: "0", fullobjects: "1", taxonomy_contact_category_for_filtering: "ol8av3v8bn" }
20
+
21
+ // Dans le composant TaxonomyFilter
22
+ useEffect(() => {
23
+ if (!isActive) {
24
+ setsecondLevelVisible(false);
25
+ setThirdLevelVisible(false);
26
+ setSelect2Value(null);
27
+ }
28
+ }, [isActive]);
29
+
30
+ useEffect(() => {
31
+ if (sub) {
32
+ const optionsSub1 = sub.map((d) => ({
33
+ value: d.token,
34
+ label: d.title,
35
+ ...(d.sub && { sub: d.sub }),
36
+ }));
37
+ setFirstLevelOptions(optionsSub1);
38
+ }
39
+ }, [sub]);
40
+ // Gestionnaire d'événements pour le clic sur le lien
41
+ const handleLinkClick = () => {
42
+ // Inverser la valeur de l'état pour afficher ou masquer la div
43
+ setsecondLevelVisible(!secondLevelVisible);
44
+ setSelect2Value(null);
45
+ setThirdLevelVisible(false);
46
+ };
47
+
48
+ // Gestionnaire d'événements pour le changement de valeur dans le premier select
49
+ const onChangeSub1 = (value, action) => {
50
+ if (value && value.sub) {
51
+ const optionsSub2 = value.sub.map((d) => ({
52
+ value: d.token,
53
+ label: d.title,
54
+ }));
55
+ setSelect2Value(value.label);
56
+ setSelect3Value(null);
57
+ setSecondLevelOptions(optionsSub2);
58
+ setThirdLevelVisible(true);
59
+ onChange(value, action);
60
+ } else {
61
+ setSecondLevelOptions(null);
62
+ }
63
+ };
64
+
65
+ // Gestionnaire d'événements pour le changement de valeur dans le deuxième select
66
+ const onChangeSub2 = (value, action) => {
67
+ setSelect3Value(value.label);
68
+ onChange(value, action);
69
+ };
70
+
71
+ // send the value to the first level (a link)
72
+ const handleApply = (value, title) => {
73
+ setCat((prevCat) => !prevCat);
74
+ if (!secondLevelVisible) {
75
+ onChange(
76
+ { value: value, label: title },
77
+ { name: "taxonomy_contact_category_for_filtering" }
78
+ );
79
+ } else {
80
+ onChange(null, { name: "taxonomy_contact_category_for_filtering" });
81
+ }
82
+ };
83
+
84
+ return (
85
+ <div onClick={onClick}>
86
+ <div
87
+ className={
88
+ secondLevelVisible ? "dropDownFilter dropDownFilter-active" : "dropDownFilter"
89
+ }
90
+ >
91
+ {/* Lien avec gestionnaire d'événements */}
92
+ <a
93
+ className="sub0"
94
+ href="#"
95
+ value={title}
96
+ onClick={(e) => {
97
+ e.preventDefault();
98
+ handleLinkClick();
99
+ handleApply(token, title); // Pass the correct value to handleApply
100
+ }}
101
+ >
102
+ {title}
103
+ </a>
104
+
105
+ {/* Div conditionnellement rendue en fonction de l'état */}
106
+ {firstLevelOptions && (
107
+ <div
108
+ className={
109
+ secondLevelVisible
110
+ ? "sub1 dropDownFilter-visible"
111
+ : "sub1 dropDownFilter-invisble"
112
+ }
113
+ >
114
+ <Select
115
+ name={"taxonomy_contact_category_for_filtering"}
116
+ className="select-custom-class library-facilities"
117
+ onChange={onChangeSub1}
118
+ options={firstLevelOptions}
119
+ value={select2Value}
120
+ placeholder={select2Value ? select2Value : "Catégories"}
121
+ />
122
+ </div>
123
+ )}
124
+
125
+ {/* Div 3 conditionnellement rendue en fonction de l'état */}
126
+ {secondLevelOptions && (
127
+ <div
128
+ className={
129
+ thirdLevelVisible
130
+ ? "sub2 dropDownFilter-visible"
131
+ : "sub2 dropDownFilter-invisble"
132
+ }
133
+ >
134
+ <Select
135
+ name={"taxonomy_contact_category_for_filtering"}
136
+ className="select-custom-class library-facilities"
137
+ onChange={onChangeSub2}
138
+ options={secondLevelOptions}
139
+ value={select3Value}
140
+ placeholder={select3Value ? select3Value : "Catégories"}
141
+ />
142
+ </div>
143
+ )}
144
+ </div>
145
+ </div>
146
+ );
147
+ }
148
+
149
+ export default TaxonomyFilter;