@logora/debate 0.4.45 → 0.4.47
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/vote/vote_box/VoteBox.module-DzckmyN1.css +1 -0
- package/dist/components/vote/vote_box/VoteBox.js +112 -104
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +45 -43
- package/package.json +1 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-B8Gtalg7.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._voteBox_1swmt_3{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:100%}._voteResultsBox_1swmt_11{display:flex!important;flex-direction:column!important;padding:0!important;width:100%}._voteResults_1swmt_11{padding:0!important}._voteProgressHeader_1swmt_22{margin-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;display:flex!important;align-items:center!important;font-size:var(--font-size-normal, 16px);display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}._voteProgressHeaderAgainst_1swmt_35{margin-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important}._voteResultsNumberVoters_1swmt_39{display:flex!important;align-items:center!important;padding:0!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F)}._voteBoxFooter_1swmt_47{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;margin-top:var(--space-unit, 1em)!important;padding:0!important}._voteBoxActions_1swmt_56{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center;gap:var(--space-unit, 1em);color:var(--text-secondary, #5F5F5F);width:100%}._voteBoxActionsBody_1swmt_66{display:grid!important;grid-template-columns:repeat(2,1fr);gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));padding:0!important;width:100%}._voteBoxActionsBodyColumn_1swmt_74{grid-template-columns:1fr}._voteAction_1swmt_78{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;padding:0!important;max-width:100%!important;width:100%!important;text-align:center}._voteAction_1swmt_78._buttonAlignLeft_1swmt_88{justify-content:flex-start!important}button._voteButton_1swmt_92,a._voteButton_1swmt_92{-webkit-appearance:initial!important;width:100%;-webkit-hyphens:auto;-ms-hyphens:auto;-moz-hyphens:auto;hyphens:auto;padding:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._textAlignLeft_1swmt_103{justify-content:flex-start!important}._voteBoxShowResultContainer_1swmt_107{display:flex!important;flex-direction:row!important;justify-content:center;flex-wrap:wrap!important;margin-top:.3em}._voteBoxShowResult_1swmt_107{cursor:pointer}._voteBoxShowResult_1swmt_107 a{color:inherit;text-decoration:none;background:none!important}._voteBoxShowResult_1swmt_107 a:hover{text-decoration:none;background:none!important}._voteBoxShowResult_1swmt_107 a:focus:not(:focus-visible){outline:none;box-shadow:none}._voteBoxShowResult_1swmt_107 ._boldShowResult_1swmt_131{font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);color:var(--text-primary, #222222)}._outlined_1swmt_137{padding:7px 15px;border-radius:var(--box-border-radius, 6px);border:1px solid var(--text-primary, #222222)!important;white-space:nowrap}._voteButtonThesis_1swmt_144{display:block;text-align:left;display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@container (max-width: 767.98px){._voteButtonThesisSynthesisMobile_1swmt_156{text-align:center!important}}._voteBoxActionsBody_1swmt_66 ._voteAction_1swmt_78:first-child ._voteButton_1swmt_92,._voteBoxActionsBody_1swmt_66 ._voteAction_1swmt_78:first-child ._voteButton_1swmt_92:hover{background-color:var(--for-primary-color, #cc6a6d)!important;border-color:var(--for-primary-color, #cc6a6d)!important;border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteBoxActionsBody_1swmt_66 ._voteAction_1swmt_78:nth-child(2) ._voteButton_1swmt_92{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_1swmt_66 ._voteAction_1swmt_78:nth-child(2) ._voteButton_1swmt_92:hover{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_1swmt_66 ._voteAction_1swmt_78:nth-child(3) ._voteButton_1swmt_92{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBody_1swmt_66 ._voteAction_1swmt_78:nth-child(3) ._voteButton_1swmt_92:hover{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBodyOutlined_1swmt_195 ._voteAction_1swmt_78:first-child ._voteButton_1swmt_92,._voteBoxActionsBodyOutlined_1swmt_195 ._voteAction_1swmt_78:first-child ._voteButton_1swmt_92:hover{background-color:var(--text-light, white)!important;color:var(--for-primary-color, #cc6a6d)!important;border-color:var(--for-primary-color, #cc6a6d)!important;border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteBoxActionsBodyOutlined_1swmt_195 ._voteAction_1swmt_78:nth-child(2) ._voteButton_1swmt_92{background-color:var(--text-light, white)!important;color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBodyOutlined_1swmt_195 ._voteAction_1swmt_78:nth-child(2) ._voteButton_1swmt_92:hover{background-color:var(--text-light, white)!important;color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBodyOutlined_1swmt_195 ._voteAction_1swmt_78:nth-child(3) ._voteButton_1swmt_92{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBodyOutlined_1swmt_195 ._voteAction_1swmt_78:nth-child(3) ._voteButton_1swmt_92:hover{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteActionButton_1swmt_234{cursor:pointer;-webkit-appearance:initial!important;background:none;border:none;color:var(--text-secondary, #5F5F5F)!important;font-size:inherit;padding:0;font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal)}._voteActionButton_1swmt_234:focus:not(:focus-visible){outline:none;box-shadow:none}._sideIcon_1swmt_250 svg{margin-left:5px;fill:var(--text-primary, #222222)}._progress_1swmt_255{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));color:var(--text-secondary, #5F5F5F);height:2.2em}._progressBar_1swmt_261{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));height:100%}._voteResults_1swmt_11>div:first-child ._progress_1swmt_255 ._progressBar_1swmt_261{background-color:var(--for-primary-color, #cc6a6d)!important}._voteResults_1swmt_11>div:nth-child(2) ._progress_1swmt_255 ._progressBar_1swmt_261{background-color:var(--against-primary-color, #7980bb)!important}._voteResults_1swmt_11 div:nth-child(3) ._progress_1swmt_255 ._progressBar_1swmt_261{background-color:var(--third-position-color-primary, #9b9b9b)!important}._voteResultsOutlined_1swmt_278>div:first-child ._progress_1swmt_255{border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteResultsOutlined_1swmt_278>div:nth-child(2) ._progress_1swmt_255{border:1px solid var(--against-primary-color, #7980bb)!important}._voteResultsOutlined_1swmt_278>div:nth-child(3) ._progress_1swmt_255{border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteCommentCounts_1swmt_290{display:flex;align-items:center;gap:var(--space-unit, 1em);width:100%;margin-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._debateNumberItem_1swmt_298{display:flex;align-items:center;gap:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25));font-size:var(--font-size-normal, 16px);color:var(--text-primary, #222222);white-space:nowrap}._debateNumberLabel_1swmt_307{white-space:nowrap}._showResultButton_1swmt_311{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}._showResultButton_1swmt_311:focus:not(:focus-visible){outline:none;box-shadow:none}._voteResultInfoText_1swmt_324{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);text-align:left;width:100%;align-self:flex-start}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as s, Fragment as pe, jsxs as
|
|
1
|
+
import { jsx as s, Fragment as pe, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import P from "@rooks/use-sessionstorage-state";
|
|
3
|
-
import
|
|
4
|
-
import { useState as b, useEffect as
|
|
3
|
+
import c from "classnames";
|
|
4
|
+
import { useState as b, useEffect as k } from "react";
|
|
5
5
|
import { useIntl as _e, FormattedMessage as m } from "react-intl";
|
|
6
6
|
import { useLocation as be } from "react-router";
|
|
7
7
|
import o from "./VoteBox.module.scss.js";
|
|
8
|
-
import { useTranslatedContent as
|
|
8
|
+
import { useTranslatedContent as T } from "../../translation/translated_content/useTranslatedContent.js";
|
|
9
9
|
import { useToast as Ne } from "../../dialog/toast_provider/useToast.js";
|
|
10
10
|
import { useAuthRequired as Se } from "../../hooks/use_auth_required/useAuthRequired.js";
|
|
11
11
|
import { useDataProvider as we } from "../../data/data_provider/useDataProvider.js";
|
|
12
12
|
import { useConfig as Be } from "../../data/config_provider/useConfig.js";
|
|
13
13
|
import { useAuth as Ce } from "../../auth/use_auth/useAuth.js";
|
|
14
|
-
import { Icon as
|
|
14
|
+
import { Icon as O } from "../../icons/icon/Icon.js";
|
|
15
15
|
import { ProgressBar as xe } from "../../progress/progress_bar/ProgressBar.js";
|
|
16
16
|
import { Link as Ve } from "../../action/link/Link.js";
|
|
17
17
|
import { Button as Me } from "../../action/button/Button.js";
|
|
@@ -24,40 +24,40 @@ const We = ({
|
|
|
24
24
|
displayColumn: j,
|
|
25
25
|
textAlignLeft: ee,
|
|
26
26
|
showTotal: te = !0,
|
|
27
|
-
voteBoxClassName:
|
|
28
|
-
buttonContainerClassName:
|
|
29
|
-
buttonClassName:
|
|
30
|
-
showResultClassName:
|
|
27
|
+
voteBoxClassName: F,
|
|
28
|
+
buttonContainerClassName: E,
|
|
29
|
+
buttonClassName: I,
|
|
30
|
+
showResultClassName: U,
|
|
31
31
|
onVote: w,
|
|
32
32
|
disabled: M = !1,
|
|
33
33
|
showVotesCommentsNumber: oe = !1,
|
|
34
34
|
commentsCount: se,
|
|
35
|
-
hideShowResultButton:
|
|
35
|
+
hideShowResultButton: H = !1
|
|
36
36
|
}) => {
|
|
37
|
-
const [
|
|
37
|
+
const [$, g] = b(!0), [l, R] = b(void 0), [p, f] = b(!1), [u, ae] = b(
|
|
38
38
|
Number.parseFloat(N.total) || Object.values(N).reduce(
|
|
39
39
|
(e, t) => e + Number.parseFloat(t),
|
|
40
40
|
0
|
|
41
41
|
) || 0
|
|
42
|
-
),
|
|
42
|
+
), q = T(
|
|
43
43
|
r[0]?.name,
|
|
44
44
|
r[0]?.language,
|
|
45
45
|
"name",
|
|
46
46
|
r[0]?.translation_entries
|
|
47
|
-
),
|
|
47
|
+
), Y = T(
|
|
48
48
|
r[1]?.name,
|
|
49
49
|
r[1]?.language,
|
|
50
50
|
"name",
|
|
51
51
|
r[1]?.translation_entries
|
|
52
|
-
),
|
|
52
|
+
), D = T(
|
|
53
53
|
r[2]?.name,
|
|
54
54
|
r[2]?.language,
|
|
55
55
|
"name",
|
|
56
56
|
r[2]?.translation_entries
|
|
57
|
-
), [_, ne,
|
|
57
|
+
), [_, ne, G] = P(
|
|
58
58
|
"storedUserVote",
|
|
59
59
|
{}
|
|
60
|
-
), [
|
|
60
|
+
), [Re, re, ie] = P("userSide", {}), { toast: W } = Ne() || {}, le = () => {
|
|
61
61
|
const e = {};
|
|
62
62
|
return r?.forEach(
|
|
63
63
|
(t) => e[t.id] = {
|
|
@@ -67,27 +67,27 @@ const We = ({
|
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
69
|
), e;
|
|
70
|
-
}, [i,
|
|
71
|
-
|
|
70
|
+
}, [i, z] = b(le()), J = Se(), ce = be(), y = we(), A = Be(), B = _e(), { isLoggedIn: C, isLoggingIn: K } = Ce();
|
|
71
|
+
k(() => {
|
|
72
72
|
K === !1 && (C ? ue(h) : g(!1));
|
|
73
|
-
}, [K, C]),
|
|
74
|
-
if (
|
|
73
|
+
}, [K, C]), k(() => {
|
|
74
|
+
if ($ === !1 && !S) {
|
|
75
75
|
const [e, t] = de();
|
|
76
76
|
e && (t ? X(t) : f(!0));
|
|
77
77
|
}
|
|
78
|
-
}, [
|
|
79
|
-
w && w(
|
|
80
|
-
}, [
|
|
78
|
+
}, [$]), k(() => {
|
|
79
|
+
w && w(l);
|
|
80
|
+
}, [l]);
|
|
81
81
|
const de = () => {
|
|
82
82
|
if (_ && Object.keys(_).length !== 0)
|
|
83
|
-
return _.groupId === h && _.voteableType === v ? [!0, _.positionId] : (
|
|
83
|
+
return _.groupId === h && _.voteableType === v ? [!0, _.positionId] : (G(), [!1, !1]);
|
|
84
84
|
const e = new URLSearchParams(
|
|
85
|
-
typeof window < "u" ? window.location.search :
|
|
85
|
+
typeof window < "u" ? window.location.search : ce.search
|
|
86
86
|
), t = !!e.get("initVote"), a = Number.parseInt(e.get("positionId")) || !1;
|
|
87
87
|
return [t, a];
|
|
88
88
|
}, ue = (e) => {
|
|
89
|
-
g(!0), w && w(
|
|
90
|
-
t.data.data.resource ? (
|
|
89
|
+
g(!0), w && w(l), y.getOneWithToken("votes", `${v.toLowerCase()}/${e}`, {}).then((t) => {
|
|
90
|
+
t.data.data.resource ? (R(t.data.data.resource), f(!0), g(!1)) : (g(!1), f(!1));
|
|
91
91
|
}).catch((t) => {
|
|
92
92
|
g(!1);
|
|
93
93
|
});
|
|
@@ -101,16 +101,16 @@ const We = ({
|
|
|
101
101
|
groupId: h,
|
|
102
102
|
voteableType: v,
|
|
103
103
|
positionId: e
|
|
104
|
-
}),
|
|
105
|
-
n.data.success && (
|
|
104
|
+
}), l ? (ve(e, l.position_id), p === !1 && L(), e !== l.position_id && y.update("votes", l.id, t).then((n) => {
|
|
105
|
+
n.data.success && (R(n.data.data.resource), W(
|
|
106
106
|
B.formatMessage({
|
|
107
107
|
id: "header.vote_confirm_modal",
|
|
108
108
|
defaultMessage: "Your vote has been saved !"
|
|
109
109
|
}),
|
|
110
110
|
{ type: "success" }
|
|
111
111
|
));
|
|
112
|
-
})) : (fe(e),
|
|
113
|
-
n.data.success && (
|
|
112
|
+
})) : (fe(e), L(), y.create("votes", t).then((n) => {
|
|
113
|
+
n.data.success && (R(n.data.data.resource), W(
|
|
114
114
|
B.formatMessage({
|
|
115
115
|
id: "header.vote_confirm_modal",
|
|
116
116
|
defaultMessage: "Your vote has been saved !"
|
|
@@ -133,7 +133,7 @@ const We = ({
|
|
|
133
133
|
percentage: x(Z, a)
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
}),
|
|
136
|
+
}), z(n), ae(a);
|
|
137
137
|
}, ve = (e, t) => {
|
|
138
138
|
if (t !== e) {
|
|
139
139
|
const a = {
|
|
@@ -153,7 +153,7 @@ const We = ({
|
|
|
153
153
|
)
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
z(a);
|
|
157
157
|
}
|
|
158
158
|
}, Q = (e) => {
|
|
159
159
|
const t = new URLSearchParams({
|
|
@@ -162,21 +162,21 @@ const We = ({
|
|
|
162
162
|
});
|
|
163
163
|
return S + `?${t.toString()}`;
|
|
164
164
|
}, X = (e) => {
|
|
165
|
-
C ? Object.keys(i).includes(e.toString()) && (me(e),
|
|
165
|
+
C ? Object.keys(i).includes(e.toString()) && (me(e), G()) : (Object.keys(i).includes(e.toString()) && ne({
|
|
166
166
|
groupId: h,
|
|
167
167
|
voteableType: v,
|
|
168
168
|
positionId: e
|
|
169
|
-
}),
|
|
170
|
-
},
|
|
169
|
+
}), J({ loginAction: "vote" }));
|
|
170
|
+
}, L = () => {
|
|
171
171
|
p && ie(), f(!p);
|
|
172
172
|
}, he = (e, t) => {
|
|
173
173
|
let a;
|
|
174
|
-
t === 0 ? a =
|
|
174
|
+
t === 0 ? a = q.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = D.translatedContent);
|
|
175
175
|
const n = typeof window < "u" && !S;
|
|
176
176
|
return /* @__PURE__ */ s(
|
|
177
177
|
"div",
|
|
178
178
|
{
|
|
179
|
-
className:
|
|
179
|
+
className: c(o.voteAction, {
|
|
180
180
|
[o.buttonAlignLeft]: o.buttonAlignLeft
|
|
181
181
|
}),
|
|
182
182
|
children: /* @__PURE__ */ s(
|
|
@@ -185,9 +185,9 @@ const We = ({
|
|
|
185
185
|
"data-tid": "action_vote",
|
|
186
186
|
type: "button",
|
|
187
187
|
title: a,
|
|
188
|
-
className:
|
|
188
|
+
className: c(o.voteButton, {
|
|
189
189
|
[o.textAlignLeft]: ee,
|
|
190
|
-
[
|
|
190
|
+
[I]: I
|
|
191
191
|
}),
|
|
192
192
|
onClick: n ? () => X(e.id) : null,
|
|
193
193
|
disabled: M,
|
|
@@ -200,7 +200,7 @@ const We = ({
|
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
202
|
"data-tid": "action_vote",
|
|
203
|
-
className:
|
|
203
|
+
className: c(o.voteButtonThesis, {
|
|
204
204
|
[o.voteButtonThesisSynthesisMobile]: !j
|
|
205
205
|
}),
|
|
206
206
|
children: a
|
|
@@ -212,56 +212,64 @@ const We = ({
|
|
|
212
212
|
t
|
|
213
213
|
);
|
|
214
214
|
}, ge = () => {
|
|
215
|
-
C ||
|
|
215
|
+
C || A.actions?.unloggedVoteResults === !0 ? f(!0) : J({ loginAction: "vote" });
|
|
216
216
|
};
|
|
217
217
|
return /* @__PURE__ */ s(
|
|
218
218
|
"div",
|
|
219
219
|
{
|
|
220
|
-
className:
|
|
221
|
-
children: /* @__PURE__ */ s(pe, { children: p || M ? /* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */ s(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
220
|
+
className: c(o.voteBox, { [F]: F }),
|
|
221
|
+
children: /* @__PURE__ */ s(pe, { children: p || M ? /* @__PURE__ */ d("div", { className: o.voteResultsBox, "data-testid": "voteResultsBox", children: [
|
|
222
|
+
/* @__PURE__ */ s(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
className: c(o.voteResults, {
|
|
226
|
+
[o.voteResultsOutlined]: A.layout?.outlinedVoteResults
|
|
227
|
+
}),
|
|
228
|
+
children: r.map((e, t) => {
|
|
229
|
+
let a;
|
|
230
|
+
return t === 0 ? a = q.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = D.translatedContent), /* @__PURE__ */ d("div", { children: [
|
|
231
|
+
/* @__PURE__ */ d(
|
|
232
|
+
"div",
|
|
233
|
+
{
|
|
234
|
+
className: t > 0 ? c(
|
|
235
|
+
o.voteProgressHeader,
|
|
236
|
+
o.voteProgressHeaderAgainst
|
|
237
|
+
) : o.voteProgressHeader,
|
|
238
|
+
children: [
|
|
239
|
+
a,
|
|
240
|
+
" ",
|
|
241
|
+
l && l.position_id === e.id ? /* @__PURE__ */ s(
|
|
242
|
+
"span",
|
|
243
|
+
{
|
|
244
|
+
title: B.formatMessage({
|
|
245
|
+
id: "vote.vote_box.vote_side"
|
|
246
|
+
}) + a,
|
|
247
|
+
className: o.sideIcon,
|
|
248
|
+
"aria-hidden": "true",
|
|
249
|
+
children: /* @__PURE__ */ s(O, { name: "checkbox", width: 16, height: 16 })
|
|
250
|
+
}
|
|
251
|
+
) : null
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
/* @__PURE__ */ d(
|
|
256
|
+
xe,
|
|
257
|
+
{
|
|
258
|
+
progress: i[e.id].percentage / 100,
|
|
259
|
+
goal: 1,
|
|
260
|
+
className: o.progress,
|
|
261
|
+
innerClassName: o.progressBar,
|
|
262
|
+
children: [
|
|
263
|
+
i[e.id].percentage,
|
|
264
|
+
"%"
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] }, t);
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ d("div", { className: o.voteBoxFooter, children: [
|
|
265
273
|
te && /* @__PURE__ */ s("div", { className: o.voteResultsNumberVoters, children: /* @__PURE__ */ s(
|
|
266
274
|
m,
|
|
267
275
|
{
|
|
@@ -270,13 +278,13 @@ const We = ({
|
|
|
270
278
|
defaultMessage: "{votesCount} votes"
|
|
271
279
|
}
|
|
272
280
|
) }),
|
|
273
|
-
!M && /* @__PURE__ */ s("div", { children:
|
|
281
|
+
!M && /* @__PURE__ */ s("div", { children: l ? /* @__PURE__ */ s(
|
|
274
282
|
"button",
|
|
275
283
|
{
|
|
276
284
|
"data-tid": "action_edit_vote",
|
|
277
285
|
className: o.voteActionButton,
|
|
278
286
|
type: "button",
|
|
279
|
-
onClick:
|
|
287
|
+
onClick: L,
|
|
280
288
|
children: /* @__PURE__ */ s(
|
|
281
289
|
m,
|
|
282
290
|
{
|
|
@@ -285,7 +293,7 @@ const We = ({
|
|
|
285
293
|
}
|
|
286
294
|
)
|
|
287
295
|
}
|
|
288
|
-
) : !
|
|
296
|
+
) : !H && /* @__PURE__ */ s(
|
|
289
297
|
"button",
|
|
290
298
|
{
|
|
291
299
|
type: "button",
|
|
@@ -301,23 +309,23 @@ const We = ({
|
|
|
301
309
|
}
|
|
302
310
|
) })
|
|
303
311
|
] })
|
|
304
|
-
] }) : /* @__PURE__ */
|
|
312
|
+
] }) : /* @__PURE__ */ d("div", { className: o.voteBoxActions, children: [
|
|
305
313
|
/* @__PURE__ */ s(
|
|
306
314
|
"div",
|
|
307
315
|
{
|
|
308
|
-
className:
|
|
316
|
+
className: c(o.voteBoxActionsBody, {
|
|
309
317
|
[o.voteBoxActionsBodyColumn]: j,
|
|
310
|
-
[o.voteBoxActionsBodyOutlined]:
|
|
311
|
-
[
|
|
318
|
+
[o.voteBoxActionsBodyOutlined]: A.layout?.outlinedVoteButtons,
|
|
319
|
+
[E]: E
|
|
312
320
|
}),
|
|
313
321
|
children: r.map(
|
|
314
322
|
(e, t) => he(e, t)
|
|
315
323
|
)
|
|
316
324
|
}
|
|
317
325
|
),
|
|
318
|
-
oe && /* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */ s(
|
|
326
|
+
oe && /* @__PURE__ */ d("div", { className: o.voteCommentCounts, children: [
|
|
327
|
+
/* @__PURE__ */ d("div", { className: o.debateNumberItem, children: [
|
|
328
|
+
/* @__PURE__ */ s(O, { name: "votebox", width: 20, height: 20 }),
|
|
321
329
|
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
322
330
|
m,
|
|
323
331
|
{
|
|
@@ -327,8 +335,8 @@ const We = ({
|
|
|
327
335
|
}
|
|
328
336
|
) })
|
|
329
337
|
] }),
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */ s(
|
|
338
|
+
/* @__PURE__ */ d("div", { className: o.debateNumberItem, children: [
|
|
339
|
+
/* @__PURE__ */ s(O, { name: "chat", width: 20, height: 20 }),
|
|
332
340
|
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
333
341
|
m,
|
|
334
342
|
{
|
|
@@ -342,12 +350,12 @@ const We = ({
|
|
|
342
350
|
/* @__PURE__ */ s(
|
|
343
351
|
"div",
|
|
344
352
|
{
|
|
345
|
-
className:
|
|
353
|
+
className: c(
|
|
346
354
|
o.voteBoxActions,
|
|
347
355
|
o.voteBoxShowResultContainer,
|
|
348
|
-
{ [
|
|
356
|
+
{ [U]: U }
|
|
349
357
|
),
|
|
350
|
-
children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children:
|
|
358
|
+
children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children: H ? !p && /* @__PURE__ */ s("div", { className: o.voteResultInfoText, children: B.formatMessage({
|
|
351
359
|
id: "vote.vote_box.result_after_vote",
|
|
352
360
|
defaultMessage: "Le résultat s'affichera après le vote."
|
|
353
361
|
}) }) : typeof window < "u" && !S ? /* @__PURE__ */ s(
|
|
@@ -358,7 +366,7 @@ const We = ({
|
|
|
358
366
|
"data-tid": "show_vote_result",
|
|
359
367
|
"data-testid": "show-result",
|
|
360
368
|
className: o.showResultButton,
|
|
361
|
-
children: /* @__PURE__ */ s("span", { className:
|
|
369
|
+
children: /* @__PURE__ */ s("span", { className: c(o.boldShowResult, o.outlined), children: /* @__PURE__ */ s(
|
|
362
370
|
m,
|
|
363
371
|
{
|
|
364
372
|
id: "vote.vote_box.show_result",
|
|
@@ -375,7 +383,7 @@ const We = ({
|
|
|
375
383
|
target: "_top",
|
|
376
384
|
external: !0,
|
|
377
385
|
"data-testid": "show-result",
|
|
378
|
-
children: /* @__PURE__ */ s("span", { className:
|
|
386
|
+
children: /* @__PURE__ */ s("span", { className: c(o.boldShowResult, o.outlined), children: /* @__PURE__ */ s(
|
|
379
387
|
m,
|
|
380
388
|
{
|
|
381
389
|
id: "vote.vote_box.show_result",
|
|
@@ -1,65 +1,67 @@
|
|
|
1
|
-
import '../../../assets/components/vote/vote_box/VoteBox.module-
|
|
2
|
-
voteBox:
|
|
3
|
-
voteResultsBox:
|
|
1
|
+
import '../../../assets/components/vote/vote_box/VoteBox.module-DzckmyN1.css';const t = "_voteBox_1swmt_3", o = "_voteResultsBox_1swmt_11", e = "_voteResults_1swmt_11", s = "_voteProgressHeader_1swmt_22", n = "_voteProgressHeaderAgainst_1swmt_35", _ = "_voteResultsNumberVoters_1swmt_39", u = "_voteBoxFooter_1swmt_47", v = "_voteBoxActions_1swmt_56", l = "_voteBoxActionsBody_1swmt_66", i = "_voteBoxActionsBodyColumn_1swmt_74", B = "_voteAction_1swmt_78", c = "_buttonAlignLeft_1swmt_88", m = "_voteButton_1swmt_92", r = "_textAlignLeft_1swmt_103", w = "_voteBoxShowResultContainer_1swmt_107", d = "_voteBoxShowResult_1swmt_107", x = "_boldShowResult_1swmt_131", b = "_outlined_1swmt_137", A = "_voteButtonThesis_1swmt_144", R = "_voteButtonThesisSynthesisMobile_1swmt_156", a = "_voteBoxActionsBodyOutlined_1swmt_195", g = "_voteActionButton_1swmt_234", h = "_sideIcon_1swmt_250", y = "_progress_1swmt_255", C = "_progressBar_1swmt_261", S = "_voteResultsOutlined_1swmt_278", f = "_voteCommentCounts_1swmt_290", I = "_debateNumberItem_1swmt_298", L = "_debateNumberLabel_1swmt_307", N = "_showResultButton_1swmt_311", T = "_voteResultInfoText_1swmt_324", p = {
|
|
2
|
+
voteBox: t,
|
|
3
|
+
voteResultsBox: o,
|
|
4
4
|
voteResults: e,
|
|
5
5
|
voteProgressHeader: s,
|
|
6
6
|
voteProgressHeaderAgainst: n,
|
|
7
7
|
voteResultsNumberVoters: _,
|
|
8
8
|
voteBoxFooter: u,
|
|
9
9
|
voteBoxActions: v,
|
|
10
|
-
voteBoxActionsBody:
|
|
11
|
-
voteBoxActionsBodyColumn:
|
|
12
|
-
voteAction:
|
|
13
|
-
buttonAlignLeft:
|
|
14
|
-
voteButton:
|
|
15
|
-
textAlignLeft:
|
|
16
|
-
voteBoxShowResultContainer:
|
|
17
|
-
voteBoxShowResult:
|
|
18
|
-
boldShowResult:
|
|
10
|
+
voteBoxActionsBody: l,
|
|
11
|
+
voteBoxActionsBodyColumn: i,
|
|
12
|
+
voteAction: B,
|
|
13
|
+
buttonAlignLeft: c,
|
|
14
|
+
voteButton: m,
|
|
15
|
+
textAlignLeft: r,
|
|
16
|
+
voteBoxShowResultContainer: w,
|
|
17
|
+
voteBoxShowResult: d,
|
|
18
|
+
boldShowResult: x,
|
|
19
19
|
outlined: b,
|
|
20
20
|
voteButtonThesis: A,
|
|
21
|
-
voteButtonThesisSynthesisMobile:
|
|
22
|
-
voteBoxActionsBodyOutlined:
|
|
21
|
+
voteButtonThesisSynthesisMobile: R,
|
|
22
|
+
voteBoxActionsBodyOutlined: a,
|
|
23
23
|
voteActionButton: g,
|
|
24
24
|
sideIcon: h,
|
|
25
|
-
progress:
|
|
26
|
-
progressBar:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
progress: y,
|
|
26
|
+
progressBar: C,
|
|
27
|
+
voteResultsOutlined: S,
|
|
28
|
+
voteCommentCounts: f,
|
|
29
|
+
debateNumberItem: I,
|
|
30
|
+
debateNumberLabel: L,
|
|
31
|
+
showResultButton: N,
|
|
32
|
+
voteResultInfoText: T
|
|
32
33
|
};
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
x as boldShowResult,
|
|
36
|
+
c as buttonAlignLeft,
|
|
37
|
+
I as debateNumberItem,
|
|
38
|
+
L as debateNumberLabel,
|
|
39
|
+
p as default,
|
|
39
40
|
b as outlined,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
y as progress,
|
|
42
|
+
C as progressBar,
|
|
43
|
+
N as showResultButton,
|
|
43
44
|
h as sideIcon,
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
r as textAlignLeft,
|
|
46
|
+
B as voteAction,
|
|
46
47
|
g as voteActionButton,
|
|
47
|
-
|
|
48
|
+
t as voteBox,
|
|
48
49
|
v as voteBoxActions,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
l as voteBoxActionsBody,
|
|
51
|
+
i as voteBoxActionsBodyColumn,
|
|
52
|
+
a as voteBoxActionsBodyOutlined,
|
|
52
53
|
u as voteBoxFooter,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
d as voteBoxShowResult,
|
|
55
|
+
w as voteBoxShowResultContainer,
|
|
56
|
+
m as voteButton,
|
|
56
57
|
A as voteButtonThesis,
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
R as voteButtonThesisSynthesisMobile,
|
|
59
|
+
f as voteCommentCounts,
|
|
59
60
|
s as voteProgressHeader,
|
|
60
61
|
n as voteProgressHeaderAgainst,
|
|
61
|
-
|
|
62
|
+
T as voteResultInfoText,
|
|
62
63
|
e as voteResults,
|
|
63
|
-
|
|
64
|
-
_ as voteResultsNumberVoters
|
|
64
|
+
o as voteResultsBox,
|
|
65
|
+
_ as voteResultsNumberVoters,
|
|
66
|
+
S as voteResultsOutlined
|
|
65
67
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._voteBox_1kfo8_3{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:100%}._voteResultsBox_1kfo8_11{display:flex!important;flex-direction:column!important;padding:0!important;width:100%}._voteResults_1kfo8_11{padding:0!important}._voteProgressHeader_1kfo8_22{margin-bottom:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important;display:flex!important;align-items:center!important;font-size:var(--font-size-normal, 16px);display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}._voteProgressHeaderAgainst_1kfo8_35{margin-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important}._voteResultsNumberVoters_1kfo8_39{display:flex!important;align-items:center!important;padding:0!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F)}._voteBoxFooter_1kfo8_47{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;margin-top:var(--space-unit, 1em)!important;padding:0!important}._voteBoxActions_1kfo8_56{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center;gap:var(--space-unit, 1em);color:var(--text-secondary, #5F5F5F);width:100%}._voteBoxActionsBody_1kfo8_66{display:grid!important;grid-template-columns:repeat(2,1fr);gap:var(--spacer-md, calc(var(--space-unit, 1em) * .75));padding:0!important;width:100%}._voteBoxActionsBodyColumn_1kfo8_74{grid-template-columns:1fr}._voteAction_1kfo8_78{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;padding:0!important;max-width:100%!important;width:100%!important;text-align:center}._voteAction_1kfo8_78._buttonAlignLeft_1kfo8_88{justify-content:flex-start!important}button._voteButton_1kfo8_92,a._voteButton_1kfo8_92{-webkit-appearance:initial!important;width:100%;-webkit-hyphens:auto;-ms-hyphens:auto;-moz-hyphens:auto;hyphens:auto;padding:var(--spacer-sm, calc(var(--space-unit, 1em) * .5))!important}._textAlignLeft_1kfo8_103{justify-content:flex-start!important}._voteBoxShowResultContainer_1kfo8_107{display:flex!important;flex-direction:row!important;justify-content:center;flex-wrap:wrap!important;margin-top:.3em}._voteBoxShowResult_1kfo8_107{cursor:pointer}._voteBoxShowResult_1kfo8_107 a{color:inherit;text-decoration:none;background:none!important}._voteBoxShowResult_1kfo8_107 a:hover{text-decoration:none;background:none!important}._voteBoxShowResult_1kfo8_107 a:focus:not(:focus-visible){outline:none;box-shadow:none}._voteBoxShowResult_1kfo8_107 ._boldShowResult_1kfo8_131{font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);color:var(--text-primary, #222222)}._outlined_1kfo8_137{padding:7px 15px;border-radius:var(--box-border-radius, 6px);border:1px solid var(--text-primary, #222222)!important;white-space:nowrap}._voteButtonThesis_1kfo8_144{display:block;text-align:left;display:-webkit-box;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@container (max-width: 767.98px){._voteButtonThesisSynthesisMobile_1kfo8_156{text-align:center!important}}._voteBoxActionsBody_1kfo8_66 ._voteAction_1kfo8_78:first-child ._voteButton_1kfo8_92,._voteBoxActionsBody_1kfo8_66 ._voteAction_1kfo8_78:first-child ._voteButton_1kfo8_92:hover{background-color:var(--for-primary-color, #cc6a6d)!important;border-color:var(--for-primary-color, #cc6a6d)!important;border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteBoxActionsBody_1kfo8_66 ._voteAction_1kfo8_78:nth-child(2) ._voteButton_1kfo8_92{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_1kfo8_66 ._voteAction_1kfo8_78:nth-child(2) ._voteButton_1kfo8_92:hover{background-color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBody_1kfo8_66 ._voteAction_1kfo8_78:nth-child(3) ._voteButton_1kfo8_92{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBody_1kfo8_66 ._voteAction_1kfo8_78:nth-child(3) ._voteButton_1kfo8_92:hover{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBodyOutlined_1kfo8_195 ._voteAction_1kfo8_78:first-child ._voteButton_1kfo8_92,._voteBoxActionsBodyOutlined_1kfo8_195 ._voteAction_1kfo8_78:first-child ._voteButton_1kfo8_92:hover{background-color:var(--text-light, white)!important;color:var(--for-primary-color, #cc6a6d)!important;border-color:var(--for-primary-color, #cc6a6d)!important;border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteBoxActionsBodyOutlined_1kfo8_195 ._voteAction_1kfo8_78:nth-child(2) ._voteButton_1kfo8_92{background-color:var(--text-light, white)!important;color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBodyOutlined_1kfo8_195 ._voteAction_1kfo8_78:nth-child(2) ._voteButton_1kfo8_92:hover{background-color:var(--text-light, white)!important;color:var(--against-primary-color, #7980bb)!important;border-color:var(--against-primary-color, #7980bb)!important;border:1px solid var(--against-primary-color, #7980bb)!important}._voteBoxActionsBodyOutlined_1kfo8_195 ._voteAction_1kfo8_78:nth-child(3) ._voteButton_1kfo8_92{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBodyOutlined_1kfo8_195 ._voteAction_1kfo8_78:nth-child(3) ._voteButton_1kfo8_92:hover{background-color:var(--text-light, white)!important;color:var(--third-position-color-primary, #9b9b9b)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteActionButton_1kfo8_234{cursor:pointer;-webkit-appearance:initial!important;background:none;border:none;color:var(--text-secondary, #5F5F5F)!important;font-size:inherit;padding:0;font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal)}._voteActionButton_1kfo8_234:focus:not(:focus-visible){outline:none;box-shadow:none}._sideIcon_1kfo8_250 svg{margin-left:5px;fill:var(--text-primary, #222222)}._progress_1kfo8_255{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));color:var(--text-secondary, #5F5F5F);height:2.2em}._progressBar_1kfo8_261{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));height:100%}._voteResults_1kfo8_11>div:first-child ._progress_1kfo8_255 ._progressBar_1kfo8_261{background-color:var(--for-primary-color, #cc6a6d)!important}._voteResults_1kfo8_11>div:nth-child(2) ._progress_1kfo8_255 ._progressBar_1kfo8_261{background-color:var(--against-primary-color, #7980bb)!important}._voteResults_1kfo8_11 div:nth-child(3) ._progress_1kfo8_255 ._progressBar_1kfo8_261{background-color:var(--third-position-color-primary, #9b9b9b)!important}._voteResults_1kfo8_11>div:first-child ._progress_1kfo8_255{border:1px solid var(--for-primary-color, #cc6a6d)!important}._voteResults_1kfo8_11>div:nth-child(2) ._progress_1kfo8_255{border:1px solid var(--against-primary-color, #7980bb)!important}._voteResults_1kfo8_11>div:nth-child(3) ._progress_1kfo8_255{border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteCommentCounts_1kfo8_290{display:flex;align-items:center;gap:var(--space-unit, 1em);width:100%;margin-top:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25))!important}._debateNumberItem_1kfo8_298{display:flex;align-items:center;gap:var(--spacer-xxs, calc(var(--space-unit, 1em) * .25));font-size:var(--font-size-normal, 16px);color:var(--text-primary, #222222);white-space:nowrap}._debateNumberLabel_1kfo8_307{white-space:nowrap}._showResultButton_1kfo8_311{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}._showResultButton_1kfo8_311:focus:not(:focus-visible){outline:none;box-shadow:none}._voteResultInfoText_1kfo8_324{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);text-align:left;width:100%;align-self:flex-start}
|