@logora/debate 0.3.90 → 0.3.91
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/dist/assets/components/argument/argument/Argument.module-QZdPjj_i.css +1 -0
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-DjNiVt-p.css +1 -0
- package/dist/assets/components/follow/follow_button/FollowButton.module-C9YXM8AM.css +1 -0
- package/dist/assets/components/input/text_editor/{TextEditor.module-DePSfOvG.css → TextEditor.module-CxuSL3l3.css} +1 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css +1 -0
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-Dm8XDnr1.css +1 -0
- package/dist/assets/components/section/section_box/SectionBox.module-qQs4B6bf.css +1 -0
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-DUPbI-wb.css +1 -0
- package/dist/assets/components/source/source_list_item/SourceListItem.module-fm_uHuY4.css +1 -0
- package/dist/assets/components/summary/summary/Summary.module-2bnx3egy.css +1 -0
- package/dist/assets/components/summary/summary_box/SummaryBox.module-Dr9PevSJ.css +1 -0
- package/dist/assets/components/vote/vote_box/VoteBox.module-D5sSSHpi.css +1 -0
- package/dist/components/argument/argument/Argument.js +111 -106
- package/dist/components/argument/argument/Argument.module.scss.js +31 -31
- package/dist/components/consultation/consultation_box/ConsultationBox.js +80 -111
- package/dist/components/consultation/consultation_box/ConsultationBox.module.scss.js +31 -29
- package/dist/components/dialog/dropdown/Dropdown.js +35 -28
- package/dist/components/follow/follow_button/FollowButton.js +17 -16
- package/dist/components/follow/follow_button/FollowButton.module.scss.js +6 -4
- package/dist/components/icons/bild_icons/index.js +58 -56
- package/dist/components/icons/hero_icons/index.js +20 -18
- package/dist/components/icons/krone_icons/index.js +48 -46
- package/dist/components/icons/regular_icons/Follow.js +6 -0
- package/dist/components/icons/regular_icons/index.js +20 -18
- package/dist/components/icons/spiegel_icons/Downvote.js +6 -0
- package/dist/components/icons/spiegel_icons/Upvote.js +6 -0
- package/dist/components/icons/spiegel_icons/index.js +54 -52
- package/dist/components/icons/stern_icons/index.js +102 -70
- package/dist/components/input/argument_input/ArgumentInput.js +201 -197
- package/dist/components/input/select/Select.js +19 -19
- package/dist/components/input/text_editor/TextEditor.js +143 -129
- package/dist/components/input/text_editor/TextEditor.module.scss.js +5 -5
- package/dist/components/input/text_editor/plugins/FocusPlugin.js +12 -8
- package/dist/components/input/text_editor/plugins/SetContentPlugin.js +13 -13
- package/dist/components/input/text_editor/plugins/SetRichContentPlugin.js +10 -10
- package/dist/components/input/text_editor/plugins/ToolbarPlugin.js +70 -72
- package/dist/components/list/paginated_list/PaginatedList.js +152 -144
- package/dist/components/list/paginated_list/action_bar/ActionBar.js +72 -61
- package/dist/components/list/paginated_list/action_bar/ActionBar.module.scss.js +18 -16
- package/dist/components/notification/notification_menu/NotificationMenu.js +23 -22
- package/dist/components/proposal/proposal_box/ProposalBox.js +70 -59
- package/dist/components/proposal/proposal_box/ProposalBox.module.scss.js +14 -10
- package/dist/components/section/section_box/SectionBox.js +10 -10
- package/dist/components/section/section_box/SectionBox.module.scss.js +9 -9
- package/dist/components/source/context_source_box/ContextSourceBox.js +7 -7
- package/dist/components/source/context_source_list/ContextSourceList.js +10 -13
- package/dist/components/source/context_source_list/ContextSourceList.module.scss.js +14 -12
- package/dist/components/source/source_list_item/SourceListItem.js +42 -28
- package/dist/components/source/source_list_item/SourceListItem.module.scss.js +8 -6
- package/dist/components/source/source_modal/SourceModal.js +15 -15
- package/dist/components/summary/summary/Summary.js +41 -63
- package/dist/components/summary/summary/Summary.module.scss.js +10 -6
- package/dist/components/summary/summary_box/SummaryBox.module.scss.js +9 -9
- package/dist/components/vote/vote_box/VoteBox.js +122 -143
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +50 -48
- package/package.json +1 -1
- package/dist/assets/components/argument/argument/Argument.module-gLfNRLks.css +0 -1
- package/dist/assets/components/consultation/consultation_box/ConsultationBox.module-BnTr5IaF.css +0 -1
- package/dist/assets/components/follow/follow_button/FollowButton.module-Da-cPgwT.css +0 -1
- package/dist/assets/components/list/paginated_list/action_bar/ActionBar.module-pxwFC_Y2.css +0 -1
- package/dist/assets/components/proposal/proposal_box/ProposalBox.module-T4ms_LQ7.css +0 -1
- package/dist/assets/components/section/section_box/SectionBox.module-DUeUtdWr.css +0 -1
- package/dist/assets/components/source/context_source_list/ContextSourceList.module-D6X_0dB7.css +0 -1
- package/dist/assets/components/source/source_list_item/SourceListItem.module-mTxHhXPV.css +0 -1
- package/dist/assets/components/summary/summary/Summary.module-DjfmUlkW.css +0 -1
- package/dist/assets/components/summary/summary_box/SummaryBox.module-DQVkA8l7.css +0 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-CDrqb2SZ.css +0 -1
|
@@ -1,237 +1,245 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useLocation as
|
|
1
|
+
import { jsxs as $, jsx as c, Fragment as Qe } from "react/jsx-runtime";
|
|
2
|
+
import $e from "@rooks/use-previous";
|
|
3
|
+
import Pe from "classnames";
|
|
4
|
+
import Ue, { useState as m, useEffect as h } from "react";
|
|
5
|
+
import { useIntl as We } from "react-intl";
|
|
6
|
+
import { useLocation as ze } from "react-router";
|
|
7
7
|
import a from "./PaginatedList.module.scss.js";
|
|
8
|
-
import { ActionBar as
|
|
9
|
-
import { useList as
|
|
10
|
-
import { useDataProvider as
|
|
11
|
-
import { useResponsive as
|
|
12
|
-
import { useData as
|
|
13
|
-
import { uniqueBy as
|
|
14
|
-
import { Pagination as
|
|
15
|
-
import { StandardErrorBoundary as
|
|
16
|
-
const
|
|
8
|
+
import { ActionBar as Ge } from "./action_bar/ActionBar.js";
|
|
9
|
+
import { useList as Ve } from "../list_provider/useList.js";
|
|
10
|
+
import { useDataProvider as Xe } from "../../data/data_provider/useDataProvider.js";
|
|
11
|
+
import { useResponsive as Ye } from "../../hooks/use_responsive/useResponsive.js";
|
|
12
|
+
import { useData as Ze } from "../../data/data_provider/useData.js";
|
|
13
|
+
import { uniqueBy as x } from "../../util/unique_by/uniqueBy.js";
|
|
14
|
+
import { Pagination as He } from "../pagination/Pagination.js";
|
|
15
|
+
import { StandardErrorBoundary as Ie } from "../../error/standard_error_boundary/StandardErrorBoundary.js";
|
|
16
|
+
const ct = ({
|
|
17
17
|
query: w,
|
|
18
18
|
sortOptions: i,
|
|
19
19
|
sort: N,
|
|
20
20
|
filters: o,
|
|
21
21
|
tagList: ne,
|
|
22
|
+
pinnedTagList: ae,
|
|
22
23
|
currentPage: M,
|
|
23
|
-
resource:
|
|
24
|
+
resource: A,
|
|
24
25
|
currentListId: n,
|
|
25
|
-
withToken:
|
|
26
|
-
perPage:
|
|
27
|
-
perPageParam:
|
|
28
|
-
pageParam:
|
|
29
|
-
sortParam:
|
|
30
|
-
queryParam:
|
|
26
|
+
withToken: le,
|
|
27
|
+
perPage: p,
|
|
28
|
+
perPageParam: ie = "per_page",
|
|
29
|
+
pageParam: oe = "page",
|
|
30
|
+
sortParam: me = "sort",
|
|
31
|
+
queryParam: de = "query",
|
|
31
32
|
tagParam: re = "tag_id",
|
|
32
33
|
totalHeaderParam: D = "total",
|
|
33
|
-
onUpdateTotal:
|
|
34
|
+
onUpdateTotal: P,
|
|
34
35
|
onElementsLoad: R,
|
|
35
|
-
transformData:
|
|
36
|
-
uniqueIdKey:
|
|
37
|
-
children:
|
|
38
|
-
resourcePropName:
|
|
39
|
-
loadingComponent:
|
|
40
|
-
searchBar:
|
|
41
|
-
title:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
transformData: U,
|
|
37
|
+
uniqueIdKey: v = "id",
|
|
38
|
+
children: fe,
|
|
39
|
+
resourcePropName: ce,
|
|
40
|
+
loadingComponent: W,
|
|
41
|
+
searchBar: ue = !1,
|
|
42
|
+
title: Ee,
|
|
43
|
+
subtitle: ge,
|
|
44
|
+
showDebateConsultationSubtitle: he = !1,
|
|
45
|
+
emptyListComponent: z,
|
|
46
|
+
emptyText: G,
|
|
47
|
+
display: V,
|
|
48
|
+
elementsPerLine: X,
|
|
49
|
+
indexLayout: pe = !1,
|
|
50
|
+
gap: ve = "1em",
|
|
51
|
+
withPagination: Se = !0,
|
|
52
|
+
numberElements: Y,
|
|
53
|
+
countless: ye,
|
|
54
|
+
onElementClick: we,
|
|
55
|
+
withUrlParams: Ne = !1,
|
|
56
|
+
onLoadNewPage: Z
|
|
54
57
|
}) => {
|
|
55
|
-
const J =
|
|
56
|
-
|
|
57
|
-
), [
|
|
58
|
+
const J = We(), t = Ve(), H = Xe(), I = ze(), { isMobile: K, isTablet: Me, isDesktop: j } = Ye(), [b, u] = m(!1), [Re, be] = m(!1), [k, S] = Ze(n, []), [O, ke] = m(
|
|
59
|
+
k?.length || 0
|
|
60
|
+
), [E, B] = m(M || 1), [y, L] = m(w || null), [C, q] = m(null), [Ce, ee] = m(null), d = new URLSearchParams(
|
|
58
61
|
typeof window < "u" ? window.location.search : I.search
|
|
59
|
-
),
|
|
62
|
+
), Fe = () => i && i[0].type === "sort" && i[0].value || N || "", Te = () => {
|
|
60
63
|
let e = {};
|
|
61
64
|
return i && i[0].type === "filter" && (e[i[0].name] = i[0].value), o && (e = Object.assign({}, e, o)), e;
|
|
62
|
-
}, [
|
|
63
|
-
M && M !==
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
for (const e of
|
|
65
|
+
}, [F, T] = m(Fe()), [Q, _] = m(Te()), te = $e(o);
|
|
66
|
+
M && M !== E && B(M), w !== void 0 && w !== y && L(w), N !== void 0 && N !== F && T(N), te && JSON.stringify(o) !== JSON.stringify(te) && JSON.stringify(o) !== JSON.stringify(Q) && _(o), h(() => {
|
|
67
|
+
if (d.get("tagId") && q(Number.parseInt(d.get("tagId"))), d.get("search") && L(d.get("search")), d.get("sort")) {
|
|
68
|
+
T(d.get("sort"));
|
|
69
|
+
for (const e of d.values()) {
|
|
67
70
|
i?.map((s) => {
|
|
68
71
|
s.value === e && ee(s.name);
|
|
69
72
|
});
|
|
70
73
|
break;
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
|
-
for (const e of
|
|
76
|
+
for (const e of d.keys()) {
|
|
74
77
|
i?.map((s) => {
|
|
75
|
-
s.name === e && (
|
|
78
|
+
s.name === e && (_({
|
|
76
79
|
...o,
|
|
77
80
|
[s.name]: s.value
|
|
78
81
|
}), ee(s.name));
|
|
79
82
|
});
|
|
80
83
|
break;
|
|
81
84
|
}
|
|
82
|
-
}, [I.search]),
|
|
83
|
-
|
|
85
|
+
}, [I.search]), h(() => {
|
|
86
|
+
A ? (B(1), S([]), u(!0), se(1)) : u(!1);
|
|
84
87
|
}, [
|
|
85
|
-
|
|
88
|
+
F,
|
|
86
89
|
Q,
|
|
87
90
|
y,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
]),
|
|
92
|
-
|
|
93
|
-
}, [
|
|
91
|
+
A,
|
|
92
|
+
C,
|
|
93
|
+
p
|
|
94
|
+
]), h(() => {
|
|
95
|
+
E > 1 && (u(!0), se(E));
|
|
96
|
+
}, [E]), h(() => {
|
|
94
97
|
if (t.addElements && n in t.addElements && t.addElements[n].length > 0) {
|
|
95
|
-
|
|
98
|
+
Ae(t.addElements[n]);
|
|
96
99
|
const e = t.addElements;
|
|
97
100
|
delete e[n], t.setAddElements(e);
|
|
98
101
|
}
|
|
99
|
-
}, [t.addElements]),
|
|
100
|
-
if (t.updateElements && n in t.updateElements && t.updateElements[n].length > 0) {
|
|
101
|
-
|
|
102
|
+
}, [t.addElements]), h(() => {
|
|
103
|
+
if (t.updateElements && n in t.updateElements && (console.log("[PaginatedList] update received for listId:", n, t.updateElements[n]), t.updateElements[n].length > 0)) {
|
|
104
|
+
De(t.updateElements[n]);
|
|
102
105
|
const e = t.updateElements;
|
|
103
106
|
delete e[n], t.setUpdateElements(e);
|
|
104
107
|
}
|
|
105
|
-
}, [t.updateElements]),
|
|
108
|
+
}, [t.updateElements]), h(() => {
|
|
106
109
|
if (t.removeElements && n in t.removeElements && t.removeElements[n].length > 0) {
|
|
107
|
-
|
|
110
|
+
Je(t.removeElements[n]);
|
|
108
111
|
const e = t.removeElements;
|
|
109
112
|
delete e[n], t.setRemoveElements(e);
|
|
110
113
|
}
|
|
111
114
|
}, [t.removeElements]);
|
|
112
|
-
const
|
|
113
|
-
e.type === "filter" ? (
|
|
115
|
+
const _e = (e) => {
|
|
116
|
+
e.type === "filter" ? (T(""), _({
|
|
114
117
|
...o,
|
|
115
118
|
[e.name]: e.value
|
|
116
|
-
})) : (
|
|
117
|
-
},
|
|
118
|
-
typeof
|
|
119
|
+
})) : (T(e.value), _(o ? { ...o } : {}));
|
|
120
|
+
}, xe = () => {
|
|
121
|
+
typeof Z == "function" && Z() !== null || B(E + 1);
|
|
119
122
|
}, se = (e) => {
|
|
120
|
-
const s =
|
|
121
|
-
if ((e - 1) *
|
|
122
|
-
const
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
...
|
|
126
|
-
...y && { [
|
|
127
|
-
...
|
|
123
|
+
const s = le ? H.getListWithToken : H.getList;
|
|
124
|
+
if ((e - 1) * p <= (Y || O) || e === 1) {
|
|
125
|
+
const r = {
|
|
126
|
+
[oe]: e,
|
|
127
|
+
[ie]: p,
|
|
128
|
+
...F && !y && { [me]: F },
|
|
129
|
+
...y && { [de]: y },
|
|
130
|
+
...ye === !0 && { countless: !0 },
|
|
128
131
|
...Q,
|
|
129
|
-
...
|
|
132
|
+
...C && { [re]: C }
|
|
130
133
|
};
|
|
131
|
-
s(
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
Number.parseInt(
|
|
135
|
-
),
|
|
136
|
-
let
|
|
137
|
-
R && R(
|
|
134
|
+
s(A, r).then((l) => {
|
|
135
|
+
const f = l.headers;
|
|
136
|
+
f && D in f && (ke(
|
|
137
|
+
Number.parseInt(f[D || "total"], 10)
|
|
138
|
+
), P && P(f[D || "total"]));
|
|
139
|
+
let g = l?.data?.data;
|
|
140
|
+
R && R(g), U && (g = g.filter(U)), t.addElements && n in t.addElements && t.addElements[n].length > 0 && (g = [...t.addElements[n], g]), je(g), u(!1);
|
|
138
141
|
}).catch((l) => {
|
|
139
|
-
console.error(l), l?.response?.status !== 404 &&
|
|
142
|
+
console.error(l), l?.response?.status !== 404 && be(!0), u(!1);
|
|
140
143
|
});
|
|
141
144
|
} else
|
|
142
|
-
|
|
143
|
-
},
|
|
145
|
+
u(!1);
|
|
146
|
+
}, Ae = (e) => {
|
|
144
147
|
S(
|
|
145
|
-
(s) =>
|
|
148
|
+
(s) => x([...e, ...s], v || "id")
|
|
146
149
|
), R && R(e);
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
(l) =>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
}, De = (e) => {
|
|
151
|
+
S((s) => {
|
|
152
|
+
let r = s;
|
|
153
|
+
return e.forEach(
|
|
154
|
+
(l) => r = r.map(
|
|
155
|
+
(f) => f.id === l.id ? l : f
|
|
156
|
+
)
|
|
157
|
+
), x(r, v || "id");
|
|
158
|
+
});
|
|
159
|
+
}, Je = (e) => {
|
|
160
|
+
const s = e.map((l) => l.id), r = k.filter(
|
|
156
161
|
(l) => s.indexOf(l.id) === -1
|
|
157
162
|
);
|
|
158
|
-
S(
|
|
159
|
-
},
|
|
163
|
+
S(x(r, v || "id"));
|
|
164
|
+
}, je = (e) => {
|
|
160
165
|
S(
|
|
161
|
-
(s) =>
|
|
166
|
+
(s) => x([...s, ...e], v || "id")
|
|
162
167
|
);
|
|
163
|
-
},
|
|
168
|
+
}, Be = (e, s) => e !== void 0 ? /* @__PURE__ */ c(
|
|
164
169
|
"li",
|
|
165
170
|
{
|
|
166
171
|
className: a.paginatedListItem,
|
|
167
172
|
"data-testid": "list-item",
|
|
168
|
-
onClick:
|
|
169
|
-
children: /* @__PURE__ */
|
|
173
|
+
onClick: we,
|
|
174
|
+
children: /* @__PURE__ */ c(Ie, { hideMessage: !0, children: Ue.cloneElement(fe, {
|
|
170
175
|
index: s,
|
|
171
|
-
[
|
|
176
|
+
[ce]: e
|
|
172
177
|
}) })
|
|
173
178
|
},
|
|
174
|
-
e[
|
|
175
|
-
) : null,
|
|
176
|
-
if (
|
|
179
|
+
`${e[v || "id"]}_${e.updated_at || e.content}`
|
|
180
|
+
) : null, Le = (e) => W ? /* @__PURE__ */ c("li", { className: a.paginatedListItem, children: W }, e) : null;
|
|
181
|
+
if (Re)
|
|
177
182
|
throw new Error(
|
|
178
183
|
J.formatMessage({
|
|
179
184
|
id: "error.list",
|
|
180
185
|
defaultMessage: "Error when loading content."
|
|
181
186
|
})
|
|
182
187
|
);
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
|
|
188
|
+
return /* @__PURE__ */ $("div", { className: a.listContainer, children: [
|
|
189
|
+
/* @__PURE__ */ c(
|
|
190
|
+
Ge,
|
|
186
191
|
{
|
|
187
|
-
title:
|
|
192
|
+
title: Ee,
|
|
193
|
+
subtitle: ge,
|
|
194
|
+
showDebateConsultationSubtitle: he,
|
|
188
195
|
sortOptions: i,
|
|
189
|
-
defaultSelectOption:
|
|
190
|
-
searchBar:
|
|
196
|
+
defaultSelectOption: Ce,
|
|
197
|
+
searchBar: ue,
|
|
191
198
|
tagList: ne,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
pinnedTagList: ae,
|
|
200
|
+
activeTagId: C,
|
|
201
|
+
onSearch: (e) => L(e),
|
|
202
|
+
onSortChange: _e,
|
|
195
203
|
onTagChange: (e) => q(e),
|
|
196
|
-
withUrlParams:
|
|
204
|
+
withUrlParams: Ne
|
|
197
205
|
}
|
|
198
206
|
),
|
|
199
|
-
!b &&
|
|
207
|
+
!b && k.length === 0 ? z ? /* @__PURE__ */ c("div", { className: a.emptyListElement, children: z }) : /* @__PURE__ */ c("div", { className: a.emptyList, children: G || J.formatMessage({
|
|
200
208
|
id: "info.emptyList",
|
|
201
209
|
defaultMessage: "No items for now."
|
|
202
|
-
}) }) : /* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
210
|
+
}) }) : /* @__PURE__ */ $(Qe, { children: [
|
|
211
|
+
/* @__PURE__ */ $(
|
|
204
212
|
"ul",
|
|
205
213
|
{
|
|
206
|
-
className:
|
|
207
|
-
[a.paginatedListIsTablet]: !K && !
|
|
208
|
-
[a.centeredList]:
|
|
209
|
-
[a.column]:
|
|
210
|
-
[a.twoElementsPerLine]:
|
|
211
|
-
[a.oneElementPerLine]:
|
|
212
|
-
[a.indexLayoutList]:
|
|
213
|
-
[a.listIsDesktop]:
|
|
214
|
-
[a.listIsTablet]:
|
|
214
|
+
className: Pe(a.paginatedList, {
|
|
215
|
+
[a.paginatedListIsTablet]: !K && !j,
|
|
216
|
+
[a.centeredList]: V === "column",
|
|
217
|
+
[a.column]: V === "column",
|
|
218
|
+
[a.twoElementsPerLine]: X === 2,
|
|
219
|
+
[a.oneElementPerLine]: X === 1,
|
|
220
|
+
[a.indexLayoutList]: pe,
|
|
221
|
+
[a.listIsDesktop]: j,
|
|
222
|
+
[a.listIsTablet]: Me && !j,
|
|
215
223
|
[a.listIsMobile]: K
|
|
216
224
|
}),
|
|
217
|
-
style: { gap:
|
|
225
|
+
style: { gap: ve },
|
|
218
226
|
children: [
|
|
219
|
-
|
|
220
|
-
b ? Array(
|
|
227
|
+
k.map(Be),
|
|
228
|
+
b ? Array(p).fill().map((e, s) => s).map(Le) : null
|
|
221
229
|
]
|
|
222
230
|
}
|
|
223
231
|
),
|
|
224
|
-
!b &&
|
|
225
|
-
|
|
232
|
+
!b && Se !== !1 && /* @__PURE__ */ c(
|
|
233
|
+
He,
|
|
226
234
|
{
|
|
227
235
|
buttonText: J.formatMessage({
|
|
228
236
|
id: "action.see_more",
|
|
229
237
|
defaultMessage: "See more"
|
|
230
238
|
}),
|
|
231
|
-
currentPage:
|
|
232
|
-
perPage:
|
|
233
|
-
totalElements:
|
|
234
|
-
onLoad:
|
|
239
|
+
currentPage: E,
|
|
240
|
+
perPage: p,
|
|
241
|
+
totalElements: Y || O,
|
|
242
|
+
onLoad: xe,
|
|
235
243
|
isLoading: b,
|
|
236
244
|
hideLoader: !0,
|
|
237
245
|
"data-tid": "list_read_more"
|
|
@@ -241,5 +249,5 @@ const rt = ({
|
|
|
241
249
|
] });
|
|
242
250
|
};
|
|
243
251
|
export {
|
|
244
|
-
|
|
252
|
+
ct as PaginatedList
|
|
245
253
|
};
|
|
@@ -1,99 +1,109 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import
|
|
7
|
-
import { useResponsive as
|
|
8
|
-
import { SearchInput as
|
|
9
|
-
import { Select as
|
|
10
|
-
import { Tag as
|
|
11
|
-
import { Icon as
|
|
12
|
-
const
|
|
1
|
+
import { jsx as i, Fragment as g, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import v from "classnames";
|
|
3
|
+
import { useState as T } from "react";
|
|
4
|
+
import { useIntl as _ } from "react-intl";
|
|
5
|
+
import { useLocation as z } from "react-router";
|
|
6
|
+
import a from "./ActionBar.module.scss.js";
|
|
7
|
+
import { useResponsive as D } from "../../../hooks/use_responsive/useResponsive.js";
|
|
8
|
+
import { SearchInput as F } from "../../../input/search_input/SearchInput.js";
|
|
9
|
+
import { Select as P } from "../../../input/select/Select.js";
|
|
10
|
+
import { Tag as E } from "../../../tag/tag/Tag.js";
|
|
11
|
+
import { Icon as G } from "../../../icons/icon/Icon.js";
|
|
12
|
+
const O = ({
|
|
13
13
|
title: n,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
subtitle: u,
|
|
15
|
+
showDebateConsultationSubtitle: y = !1,
|
|
16
|
+
sortOptions: r,
|
|
17
|
+
defaultSelectOption: A,
|
|
18
|
+
searchBar: s = !1,
|
|
19
|
+
tagList: o,
|
|
20
|
+
pinnedTagList: c = [],
|
|
21
|
+
activeTagId: d,
|
|
22
|
+
withUrlParams: m = !1,
|
|
23
|
+
onSearch: I,
|
|
24
|
+
onSortChange: N,
|
|
25
|
+
onTagChange: w
|
|
23
26
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
typeof window < "u" ? window.location.search :
|
|
26
|
-
),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const x = _(), b = z(), { isMobile: J } = D(), [k, C] = T(!1), l = new URLSearchParams(
|
|
28
|
+
typeof window < "u" ? window.location.search : b.search
|
|
29
|
+
), f = Array.isArray(o) ? o : o?.data || [], p = [
|
|
30
|
+
...new Set(
|
|
31
|
+
(Array.isArray(c) ? c : [c]).filter(Boolean).map(String)
|
|
32
|
+
)
|
|
33
|
+
], S = f.length > 0 ? [
|
|
34
|
+
...p.map((e) => f.find((t) => String(t.id) === e)).filter(Boolean),
|
|
35
|
+
...f.filter((e) => !p.includes(String(e.id)))
|
|
36
|
+
] : [], M = (e) => {
|
|
37
|
+
if (m) {
|
|
38
|
+
for (const t of l.keys())
|
|
39
|
+
r.map((R) => {
|
|
40
|
+
R.name === t && l.delete(t);
|
|
31
41
|
});
|
|
32
|
-
|
|
42
|
+
l.delete("sort"), l.set(
|
|
33
43
|
e.type === "filter" ? e.name : "sort",
|
|
34
44
|
e.value
|
|
35
45
|
);
|
|
36
46
|
}
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
const t =
|
|
47
|
+
N(e);
|
|
48
|
+
}, j = (e) => {
|
|
49
|
+
m && (e.id === d ? l.delete("tagId") : l.set("tagId", e.id)), w(e.id === d ? null : e.id);
|
|
50
|
+
}, B = (e) => {
|
|
51
|
+
m && (e ? l.set("search", e) : l.delete("search")), I(e), C(e !== "");
|
|
52
|
+
}, H = (e) => {
|
|
53
|
+
const t = d === e.id;
|
|
44
54
|
return /* @__PURE__ */ i(
|
|
45
55
|
"div",
|
|
46
56
|
{
|
|
47
|
-
className:
|
|
48
|
-
onClick: () =>
|
|
57
|
+
className: a.tagItem,
|
|
58
|
+
onClick: () => j(e),
|
|
49
59
|
children: /* @__PURE__ */ i(
|
|
50
|
-
|
|
60
|
+
E,
|
|
51
61
|
{
|
|
52
62
|
text: e.display_name,
|
|
53
63
|
active: t,
|
|
54
|
-
rightIcon: t && /* @__PURE__ */ i(
|
|
64
|
+
rightIcon: t && /* @__PURE__ */ i(G, { name: "close", height: 10, width: 10 })
|
|
55
65
|
}
|
|
56
66
|
)
|
|
57
67
|
},
|
|
58
68
|
e.id
|
|
59
69
|
);
|
|
60
70
|
};
|
|
61
|
-
return /* @__PURE__ */ i(
|
|
62
|
-
/* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ i(g, { children: (n || r || s) && /* @__PURE__ */ h(g, { children: [
|
|
72
|
+
/* @__PURE__ */ h(
|
|
63
73
|
"div",
|
|
64
74
|
{
|
|
65
|
-
className:
|
|
66
|
-
[
|
|
75
|
+
className: v(a.listHeader, {
|
|
76
|
+
[a.listHeaderOneItem]: !s || !r
|
|
67
77
|
}),
|
|
68
78
|
children: [
|
|
69
|
-
n && /* @__PURE__ */ i("div", { className:
|
|
70
|
-
(
|
|
79
|
+
n && /* @__PURE__ */ i("div", { className: a.listTitle, children: n }),
|
|
80
|
+
(r || s) && /* @__PURE__ */ h(
|
|
71
81
|
"div",
|
|
72
82
|
{
|
|
73
|
-
className:
|
|
74
|
-
[
|
|
83
|
+
className: v(a.rightBar, {
|
|
84
|
+
[a.rightBarOneItem]: !s || !r
|
|
75
85
|
}),
|
|
76
86
|
children: [
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
s ? /* @__PURE__ */ i("div", { className: a.search, children: /* @__PURE__ */ i(
|
|
88
|
+
F,
|
|
79
89
|
{
|
|
80
|
-
onSearchSubmit:
|
|
81
|
-
placeholder:
|
|
90
|
+
onSearchSubmit: B,
|
|
91
|
+
placeholder: x.formatMessage({
|
|
82
92
|
id: "info.search_mobile",
|
|
83
93
|
defaultMessage: "Search"
|
|
84
94
|
}),
|
|
85
95
|
reducedByDefault: !1
|
|
86
96
|
}
|
|
87
97
|
) }) : null,
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
r ? /* @__PURE__ */ i(
|
|
99
|
+
P,
|
|
90
100
|
{
|
|
91
|
-
onChange:
|
|
92
|
-
options:
|
|
93
|
-
defaultOption:
|
|
101
|
+
onChange: M,
|
|
102
|
+
options: r,
|
|
103
|
+
defaultOption: A,
|
|
94
104
|
horizontalPosition: "right",
|
|
95
|
-
disabled:
|
|
96
|
-
className:
|
|
105
|
+
disabled: k,
|
|
106
|
+
className: a.select
|
|
97
107
|
}
|
|
98
108
|
) : null
|
|
99
109
|
]
|
|
@@ -102,9 +112,10 @@ const X = ({
|
|
|
102
112
|
]
|
|
103
113
|
}
|
|
104
114
|
),
|
|
105
|
-
|
|
115
|
+
y && u && /* @__PURE__ */ i("div", { className: a.listSubtitle, children: u }),
|
|
116
|
+
S.length > 0 && /* @__PURE__ */ i("div", { className: a.tagList, children: S.map(H) })
|
|
106
117
|
] }) });
|
|
107
118
|
};
|
|
108
119
|
export {
|
|
109
|
-
|
|
120
|
+
O as ActionBar
|
|
110
121
|
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-
|
|
1
|
+
import '../../../../assets/components/list/paginated_list/action_bar/ActionBar.module-DvwCbS9k.css';const t = "_listHeader_un1z2_3", e = "_listHeaderOneItem_un1z2_16", s = "_listTitle_un1z2_23", _ = "_listSubtitle_un1z2_30", i = "_rightBar_un1z2_37", n = "_rightBarOneItem_un1z2_47", a = "_search_un1z2_58", l = "_tagList_un1z2_68", r = "_tagItem_un1z2_83", c = "_select_un1z2_90", u = {
|
|
2
2
|
listHeader: t,
|
|
3
3
|
listHeaderOneItem: e,
|
|
4
|
-
listTitle:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
listTitle: s,
|
|
5
|
+
listSubtitle: _,
|
|
6
|
+
rightBar: i,
|
|
7
|
+
rightBarOneItem: n,
|
|
8
|
+
search: a,
|
|
9
|
+
tagList: l,
|
|
10
|
+
tagItem: r,
|
|
11
|
+
select: c
|
|
11
12
|
};
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
u as default,
|
|
14
15
|
t as listHeader,
|
|
15
16
|
e as listHeaderOneItem,
|
|
16
|
-
|
|
17
|
-
s as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
r as
|
|
17
|
+
_ as listSubtitle,
|
|
18
|
+
s as listTitle,
|
|
19
|
+
i as rightBar,
|
|
20
|
+
n as rightBarOneItem,
|
|
21
|
+
a as search,
|
|
22
|
+
c as select,
|
|
23
|
+
r as tagItem,
|
|
24
|
+
l as tagList
|
|
23
25
|
};
|