@logora/debate 0.4.69 → 0.4.72
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-BM2Iqu7I.css +1 -0
- package/dist/components/vote/vote_box/VoteBox.js +72 -71
- package/dist/components/vote/vote_box/VoteBox.module.scss.js +36 -34
- package/package.json +1 -1
- package/dist/assets/components/vote/vote_box/VoteBox.module-Bv7WY_vr.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._voteBox_1y5hn_3{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:100%}._voteResultsBox_1y5hn_11{display:flex!important;flex-direction:column!important;padding:0!important;width:100%}._voteResults_1y5hn_11{padding:0!important}._voteProgressHeader_1y5hn_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_1y5hn_35{margin-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important}._voteResultsNumberVoters_1y5hn_39{display:flex!important;align-items:center!important;padding:0!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F)}._voteBoxFooter_1y5hn_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_1y5hn_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_1y5hn_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_1y5hn_74{grid-template-columns:1fr}._voteAction_1y5hn_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_1y5hn_78._buttonAlignLeft_1y5hn_88{justify-content:flex-start!important}button._voteButton_1y5hn_92,a._voteButton_1y5hn_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_1y5hn_103{justify-content:flex-start!important}._voteBoxShowResultContainer_1y5hn_107{display:flex!important;flex-direction:row!important;justify-content:center;flex-wrap:wrap!important;margin-top:.3em}._voteBoxShowResult_1y5hn_107{cursor:pointer}._voteBoxShowResult_1y5hn_107 a{color:inherit;text-decoration:none;background:none!important}._voteBoxShowResult_1y5hn_107 a:hover{text-decoration:none;background:none!important}._voteBoxShowResult_1y5hn_107 a:focus:not(:focus-visible){outline:none;box-shadow:none}._voteBoxShowResult_1y5hn_107 ._boldShowResult_1y5hn_131{font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);color:var(--text-primary, #222222)}._outlined_1y5hn_137{padding:7px 15px;border-radius:var(--box-border-radius, 6px);border:1px solid var(--text-primary, #222222)!important;white-space:nowrap}._voteButtonThesis_1y5hn_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_1y5hn_156{text-align:center!important}}._voteBoxActionsBody_1y5hn_66 ._voteAction_1y5hn_78:first-child ._voteButton_1y5hn_92,._voteBoxActionsBody_1y5hn_66 ._voteAction_1y5hn_78:first-child ._voteButton_1y5hn_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_1y5hn_66 ._voteAction_1y5hn_78:nth-child(2) ._voteButton_1y5hn_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_1y5hn_66 ._voteAction_1y5hn_78:nth-child(2) ._voteButton_1y5hn_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_1y5hn_66 ._voteAction_1y5hn_78:nth-child(3) ._voteButton_1y5hn_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_1y5hn_66 ._voteAction_1y5hn_78:nth-child(3) ._voteButton_1y5hn_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_1y5hn_195 ._voteAction_1y5hn_78:first-child ._voteButton_1y5hn_92,._voteBoxActionsBodyOutlined_1y5hn_195 ._voteAction_1y5hn_78:first-child ._voteButton_1y5hn_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_1y5hn_195 ._voteAction_1y5hn_78:nth-child(2) ._voteButton_1y5hn_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_1y5hn_195 ._voteAction_1y5hn_78:nth-child(2) ._voteButton_1y5hn_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_1y5hn_195 ._voteAction_1y5hn_78:nth-child(3) ._voteButton_1y5hn_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_1y5hn_195 ._voteAction_1y5hn_78:nth-child(3) ._voteButton_1y5hn_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}._voteBoxActionsBodyFilledNeutral_1y5hn_234 ._voteAction_1y5hn_78:nth-child(3) ._voteButton_1y5hn_92{background-color:var(--third-position-color-primary, #9b9b9b)!important;color:var(--text-light, white)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteBoxActionsBodyFilledNeutral_1y5hn_234 ._voteAction_1y5hn_78:nth-child(3) ._voteButton_1y5hn_92:hover{background-color:var(--third-position-color-primary, #9b9b9b)!important;color:var(--text-light, white)!important;border-color:var(--third-position-color-primary, #9b9b9b)!important;border:1px solid var(--third-position-color-primary, #9b9b9b)!important}._voteActionButton_1y5hn_247{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_1y5hn_247:focus:not(:focus-visible){outline:none;box-shadow:none}._sideIcon_1y5hn_263 svg{margin-left:5px;fill:var(--text-primary, #222222)}._progress_1y5hn_268{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));color:var(--text-secondary, #5F5F5F);height:2.2em}._progressBar_1y5hn_274{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));height:100%}._voteResults_1y5hn_11>div:first-child ._progress_1y5hn_268 ._progressBar_1y5hn_274{background-color:var(--for-primary-color, #cc6a6d)!important}._voteResults_1y5hn_11>div:nth-child(2) ._progress_1y5hn_268 ._progressBar_1y5hn_274{background-color:var(--against-primary-color, #7980bb)!important}._voteResults_1y5hn_11 div:nth-child(3) ._progress_1y5hn_268 ._progressBar_1y5hn_274{background-color:var(--third-position-color-primary, #9b9b9b)!important}._voteCommentCounts_1y5hn_291{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_1y5hn_299{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_1y5hn_308{white-space:nowrap}._showResultButton_1y5hn_312{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}._showResultButton_1y5hn_312:focus:not(:focus-visible){outline:none;box-shadow:none}._voteResultInfoText_1y5hn_325{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);text-align:left;width:100%;align-self:flex-start}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as s, Fragment as pe, jsxs as
|
|
1
|
+
import { jsx as s, Fragment as pe, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import P from "@rooks/use-sessionstorage-state";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as N, useEffect as T } from "react";
|
|
5
5
|
import { useIntl as _e, FormattedMessage as f } from "react-intl";
|
|
6
|
-
import { useLocation as
|
|
6
|
+
import { useLocation as Ne } from "react-router";
|
|
7
7
|
import o from "./VoteBox.module.scss.js";
|
|
8
|
-
import { useTranslatedContent as
|
|
9
|
-
import { useToast as
|
|
8
|
+
import { useTranslatedContent as j } from "../../translation/translated_content/useTranslatedContent.js";
|
|
9
|
+
import { useToast as be } 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 F } 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
|
-
import { Button as
|
|
17
|
+
import { Button as ye } from "../../action/button/Button.js";
|
|
18
18
|
const We = ({
|
|
19
|
-
numberVotes:
|
|
19
|
+
numberVotes: b,
|
|
20
20
|
votePositions: r,
|
|
21
21
|
voteableType: v,
|
|
22
22
|
voteableId: h,
|
|
@@ -24,70 +24,70 @@ const We = ({
|
|
|
24
24
|
displayColumn: O,
|
|
25
25
|
textAlignLeft: ee,
|
|
26
26
|
showTotal: te = !0,
|
|
27
|
-
voteBoxClassName:
|
|
28
|
-
buttonContainerClassName:
|
|
29
|
-
buttonClassName:
|
|
30
|
-
showResultClassName:
|
|
27
|
+
voteBoxClassName: E,
|
|
28
|
+
buttonContainerClassName: I,
|
|
29
|
+
buttonClassName: U,
|
|
30
|
+
showResultClassName: H,
|
|
31
31
|
onVote: w,
|
|
32
32
|
disabled: A = !1,
|
|
33
33
|
showVotesCommentsNumber: oe = !1,
|
|
34
34
|
commentsCount: se,
|
|
35
|
-
hideShowResultButton:
|
|
35
|
+
hideShowResultButton: $ = !1
|
|
36
36
|
}) => {
|
|
37
|
-
const [B, g] =
|
|
38
|
-
Number.parseFloat(
|
|
37
|
+
const [B, g] = N(!0), [l, M] = N(void 0), [p, m] = N(!1), [u, ae] = N(
|
|
38
|
+
Number.parseFloat(b.total) || Object.values(b).reduce(
|
|
39
39
|
(e, t) => e + Number.parseFloat(t),
|
|
40
40
|
0
|
|
41
41
|
) || 0
|
|
42
|
-
),
|
|
42
|
+
), q = j(
|
|
43
43
|
r[0]?.name,
|
|
44
44
|
r[0]?.language,
|
|
45
45
|
"name",
|
|
46
46
|
r[0]?.translation_entries
|
|
47
|
-
),
|
|
47
|
+
), Y = j(
|
|
48
48
|
r[1]?.name,
|
|
49
49
|
r[1]?.language,
|
|
50
50
|
"name",
|
|
51
51
|
r[1]?.translation_entries
|
|
52
|
-
),
|
|
52
|
+
), D = j(
|
|
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
|
-
), [Ae, re, ie] = P("userSide", {}), { toast:
|
|
60
|
+
), [Ae, re, ie] = P("userSide", {}), { toast: W } = be() || {}, le = () => {
|
|
61
61
|
const e = {};
|
|
62
62
|
return r?.forEach(
|
|
63
63
|
(t) => e[t.id] = {
|
|
64
|
-
count: Number.parseFloat(
|
|
64
|
+
count: Number.parseFloat(b[t.id]) || 0,
|
|
65
65
|
percentage: u === 0 ? 0 : Math.round(
|
|
66
|
-
100 * ((
|
|
66
|
+
100 * ((b[t.id] || 0) / u)
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
69
|
), e;
|
|
70
|
-
}, [i,
|
|
71
|
-
|
|
70
|
+
}, [i, z] = N(le()), J = Se(), ce = Ne(), R = we(), L = Be(), C = _e(), { isLoggedIn: x, isLoggingIn: K } = Ce();
|
|
71
|
+
T(() => {
|
|
72
72
|
K === !1 && (x ? ue(h) : g(!1));
|
|
73
|
-
}, [K, x]),
|
|
73
|
+
}, [K, x]), T(() => {
|
|
74
74
|
if (B === !1 && !S) {
|
|
75
75
|
const [e, t] = de();
|
|
76
76
|
e && (t ? X(t) : m(!0));
|
|
77
77
|
}
|
|
78
|
-
}, [B]),
|
|
79
|
-
w && w(
|
|
80
|
-
}, [
|
|
78
|
+
}, [B]), T(() => {
|
|
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), R.getOneWithToken("votes", `${v.toLowerCase()}/${e}`, {}).then((t) => {
|
|
90
|
+
t.data.data.resource ? (M(t.data.data.resource), m(!0), g(!1)) : (g(!1), m(!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 && k(), e !== l.position_id && R.update("votes", l.id, t).then((n) => {
|
|
105
|
+
n.data.success && (M(n.data.data.resource), W(
|
|
106
106
|
C.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
|
-
})) : (me(e),
|
|
113
|
-
n.data.success && (
|
|
112
|
+
})) : (me(e), k(), R.create("votes", t).then((n) => {
|
|
113
|
+
n.data.success && (M(n.data.data.resource), W(
|
|
114
114
|
C.formatMessage({
|
|
115
115
|
id: "header.vote_confirm_modal",
|
|
116
116
|
defaultMessage: "Your vote has been saved !"
|
|
@@ -120,20 +120,20 @@ const We = ({
|
|
|
120
120
|
}));
|
|
121
121
|
}, me = (e) => {
|
|
122
122
|
const t = i[e].count + 1, a = u + 1, n = {};
|
|
123
|
-
r.forEach((
|
|
124
|
-
if (e ===
|
|
125
|
-
n[
|
|
123
|
+
r.forEach((y) => {
|
|
124
|
+
if (e === y.id)
|
|
125
|
+
n[y.id] = {
|
|
126
126
|
count: t,
|
|
127
127
|
percentage: V(t, a)
|
|
128
128
|
};
|
|
129
129
|
else {
|
|
130
|
-
const Z = i[
|
|
131
|
-
n[
|
|
130
|
+
const Z = i[y.id].count;
|
|
131
|
+
n[y.id] = {
|
|
132
132
|
count: Z,
|
|
133
133
|
percentage: V(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,16 +162,16 @@ const We = ({
|
|
|
162
162
|
});
|
|
163
163
|
return S + `?${t.toString()}`;
|
|
164
164
|
}, X = (e) => {
|
|
165
|
-
B || (x ? Object.keys(i).includes(e.toString()) && (fe(e),
|
|
165
|
+
B || (x ? Object.keys(i).includes(e.toString()) && (fe(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
|
+
}, k = () => {
|
|
171
171
|
p && ie(), m(!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",
|
|
@@ -180,14 +180,14 @@ const We = ({
|
|
|
180
180
|
[o.buttonAlignLeft]: o.buttonAlignLeft
|
|
181
181
|
}),
|
|
182
182
|
children: /* @__PURE__ */ s(
|
|
183
|
-
|
|
183
|
+
ye,
|
|
184
184
|
{
|
|
185
185
|
"data-tid": "action_vote",
|
|
186
186
|
type: "button",
|
|
187
187
|
title: a,
|
|
188
188
|
className: d(o.voteButton, {
|
|
189
189
|
[o.textAlignLeft]: ee,
|
|
190
|
-
[
|
|
190
|
+
[U]: U
|
|
191
191
|
}),
|
|
192
192
|
onClick: n ? () => X(e.id) : null,
|
|
193
193
|
disabled: A || n && B,
|
|
@@ -212,17 +212,17 @@ const We = ({
|
|
|
212
212
|
t
|
|
213
213
|
);
|
|
214
214
|
}, ge = () => {
|
|
215
|
-
x ||
|
|
215
|
+
x || L.actions?.unloggedVoteResults === !0 ? m(!0) : J({ loginAction: "vote" });
|
|
216
216
|
};
|
|
217
217
|
return /* @__PURE__ */ s(
|
|
218
218
|
"div",
|
|
219
219
|
{
|
|
220
|
-
className: d(o.voteBox, { [
|
|
221
|
-
children: /* @__PURE__ */ s(pe, { children: p || A ? /* @__PURE__ */
|
|
220
|
+
className: d(o.voteBox, { [E]: E }),
|
|
221
|
+
children: /* @__PURE__ */ s(pe, { children: p || A ? /* @__PURE__ */ c("div", { className: o.voteResultsBox, "data-testid": "voteResultsBox", children: [
|
|
222
222
|
/* @__PURE__ */ s("div", { className: o.voteResults, children: r.map((e, t) => {
|
|
223
223
|
let a;
|
|
224
|
-
return t === 0 ? a =
|
|
225
|
-
/* @__PURE__ */
|
|
224
|
+
return t === 0 ? a = q.translatedContent : t === 1 ? a = Y.translatedContent : t === 2 && (a = D.translatedContent), /* @__PURE__ */ c("div", { children: [
|
|
225
|
+
/* @__PURE__ */ c(
|
|
226
226
|
"div",
|
|
227
227
|
{
|
|
228
228
|
className: t > 0 ? d(
|
|
@@ -232,7 +232,7 @@ const We = ({
|
|
|
232
232
|
children: [
|
|
233
233
|
a,
|
|
234
234
|
" ",
|
|
235
|
-
|
|
235
|
+
l && l.position_id === e.id ? /* @__PURE__ */ s(
|
|
236
236
|
"span",
|
|
237
237
|
{
|
|
238
238
|
title: C.formatMessage({
|
|
@@ -240,13 +240,13 @@ const We = ({
|
|
|
240
240
|
}) + a,
|
|
241
241
|
className: o.sideIcon,
|
|
242
242
|
"aria-hidden": "true",
|
|
243
|
-
children: /* @__PURE__ */ s(
|
|
243
|
+
children: /* @__PURE__ */ s(F, { name: "checkbox", width: 16, height: 16 })
|
|
244
244
|
}
|
|
245
245
|
) : null
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ c(
|
|
250
250
|
xe,
|
|
251
251
|
{
|
|
252
252
|
progress: i[e.id].percentage / 100,
|
|
@@ -261,7 +261,7 @@ const We = ({
|
|
|
261
261
|
)
|
|
262
262
|
] }, t);
|
|
263
263
|
}) }),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ c("div", { className: o.voteBoxFooter, children: [
|
|
265
265
|
te && /* @__PURE__ */ s("div", { className: o.voteResultsNumberVoters, children: /* @__PURE__ */ s(
|
|
266
266
|
f,
|
|
267
267
|
{
|
|
@@ -270,13 +270,13 @@ const We = ({
|
|
|
270
270
|
defaultMessage: "{votesCount} votes"
|
|
271
271
|
}
|
|
272
272
|
) }),
|
|
273
|
-
!A && /* @__PURE__ */ s("div", { children:
|
|
273
|
+
!A && /* @__PURE__ */ s("div", { children: l ? /* @__PURE__ */ s(
|
|
274
274
|
"button",
|
|
275
275
|
{
|
|
276
276
|
"data-tid": "action_edit_vote",
|
|
277
277
|
className: o.voteActionButton,
|
|
278
278
|
type: "button",
|
|
279
|
-
onClick:
|
|
279
|
+
onClick: k,
|
|
280
280
|
children: /* @__PURE__ */ s(
|
|
281
281
|
f,
|
|
282
282
|
{
|
|
@@ -285,7 +285,7 @@ const We = ({
|
|
|
285
285
|
}
|
|
286
286
|
)
|
|
287
287
|
}
|
|
288
|
-
) :
|
|
288
|
+
) : !$ && /* @__PURE__ */ s(
|
|
289
289
|
"button",
|
|
290
290
|
{
|
|
291
291
|
type: "button",
|
|
@@ -301,23 +301,24 @@ const We = ({
|
|
|
301
301
|
}
|
|
302
302
|
) })
|
|
303
303
|
] })
|
|
304
|
-
] }) : /* @__PURE__ */
|
|
304
|
+
] }) : /* @__PURE__ */ c("div", { className: o.voteBoxActions, children: [
|
|
305
305
|
/* @__PURE__ */ s(
|
|
306
306
|
"div",
|
|
307
307
|
{
|
|
308
308
|
className: d(o.voteBoxActionsBody, {
|
|
309
309
|
[o.voteBoxActionsBodyColumn]: O,
|
|
310
|
-
[o.voteBoxActionsBodyOutlined]:
|
|
311
|
-
[
|
|
310
|
+
[o.voteBoxActionsBodyOutlined]: L.layout?.outlinedVoteButtons,
|
|
311
|
+
[o.voteBoxActionsBodyFilledNeutral]: L.layout?.filledNeutralVoteButton,
|
|
312
|
+
[I]: I
|
|
312
313
|
}),
|
|
313
314
|
children: r.map(
|
|
314
315
|
(e, t) => he(e, t)
|
|
315
316
|
)
|
|
316
317
|
}
|
|
317
318
|
),
|
|
318
|
-
oe && /* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */ s(
|
|
319
|
+
oe && /* @__PURE__ */ c("div", { className: o.voteCommentCounts, children: [
|
|
320
|
+
/* @__PURE__ */ c("div", { className: o.debateNumberItem, children: [
|
|
321
|
+
/* @__PURE__ */ s(F, { name: "votebox", width: 20, height: 20 }),
|
|
321
322
|
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
322
323
|
f,
|
|
323
324
|
{
|
|
@@ -327,8 +328,8 @@ const We = ({
|
|
|
327
328
|
}
|
|
328
329
|
) })
|
|
329
330
|
] }),
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */ s(
|
|
331
|
+
/* @__PURE__ */ c("div", { className: o.debateNumberItem, children: [
|
|
332
|
+
/* @__PURE__ */ s(F, { name: "chat", width: 20, height: 20 }),
|
|
332
333
|
/* @__PURE__ */ s("div", { className: o.debateNumberLabel, children: /* @__PURE__ */ s(
|
|
333
334
|
f,
|
|
334
335
|
{
|
|
@@ -345,9 +346,9 @@ const We = ({
|
|
|
345
346
|
className: d(
|
|
346
347
|
o.voteBoxActions,
|
|
347
348
|
o.voteBoxShowResultContainer,
|
|
348
|
-
{ [
|
|
349
|
+
{ [H]: H }
|
|
349
350
|
),
|
|
350
|
-
children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children:
|
|
351
|
+
children: /* @__PURE__ */ s("div", { className: o.voteBoxShowResult, children: $ ? !p && /* @__PURE__ */ s("div", { className: o.voteResultInfoText, children: C.formatMessage({
|
|
351
352
|
id: "vote.vote_box.result_after_vote",
|
|
352
353
|
defaultMessage: "Le résultat s'affichera après le vote."
|
|
353
354
|
}) }) : typeof window < "u" && !S ? /* @__PURE__ */ s(
|
|
@@ -1,64 +1,66 @@
|
|
|
1
|
-
import '../../../assets/components/vote/vote_box/VoteBox.module-
|
|
1
|
+
import '../../../assets/components/vote/vote_box/VoteBox.module-BM2Iqu7I.css';const o = "_voteBox_1y5hn_3", t = "_voteResultsBox_1y5hn_11", e = "_voteResults_1y5hn_11", n = "_voteProgressHeader_1y5hn_22", s = "_voteProgressHeaderAgainst_1y5hn_35", _ = "_voteResultsNumberVoters_1y5hn_39", u = "_voteBoxFooter_1y5hn_47", v = "_voteBoxActions_1y5hn_56", B = "_voteBoxActionsBody_1y5hn_66", l = "_voteBoxActionsBodyColumn_1y5hn_74", i = "_voteAction_1y5hn_78", c = "_buttonAlignLeft_1y5hn_88", r = "_voteButton_1y5hn_92", h = "_textAlignLeft_1y5hn_103", y = "_voteBoxShowResultContainer_1y5hn_107", d = "_voteBoxShowResult_1y5hn_107", x = "_boldShowResult_1y5hn_131", A = "_outlined_1y5hn_137", a = "_voteButtonThesis_1y5hn_144", b = "_voteButtonThesisSynthesisMobile_1y5hn_156", R = "_voteBoxActionsBodyOutlined_1y5hn_195", g = "_voteBoxActionsBodyFilledNeutral_1y5hn_234", m = "_voteActionButton_1y5hn_247", w = "_sideIcon_1y5hn_263", C = "_progress_1y5hn_268", N = "_progressBar_1y5hn_274", S = "_voteCommentCounts_1y5hn_291", f = "_debateNumberItem_1y5hn_299", I = "_debateNumberLabel_1y5hn_308", L = "_showResultButton_1y5hn_312", T = "_voteResultInfoText_1y5hn_325", p = {
|
|
2
2
|
voteBox: o,
|
|
3
3
|
voteResultsBox: t,
|
|
4
4
|
voteResults: e,
|
|
5
|
-
voteProgressHeader:
|
|
6
|
-
voteProgressHeaderAgainst:
|
|
5
|
+
voteProgressHeader: n,
|
|
6
|
+
voteProgressHeaderAgainst: s,
|
|
7
7
|
voteResultsNumberVoters: _,
|
|
8
8
|
voteBoxFooter: u,
|
|
9
9
|
voteBoxActions: v,
|
|
10
10
|
voteBoxActionsBody: B,
|
|
11
|
-
voteBoxActionsBodyColumn:
|
|
12
|
-
voteAction:
|
|
13
|
-
buttonAlignLeft:
|
|
14
|
-
voteButton:
|
|
15
|
-
textAlignLeft:
|
|
16
|
-
voteBoxShowResultContainer:
|
|
11
|
+
voteBoxActionsBodyColumn: l,
|
|
12
|
+
voteAction: i,
|
|
13
|
+
buttonAlignLeft: c,
|
|
14
|
+
voteButton: r,
|
|
15
|
+
textAlignLeft: h,
|
|
16
|
+
voteBoxShowResultContainer: y,
|
|
17
17
|
voteBoxShowResult: d,
|
|
18
18
|
boldShowResult: x,
|
|
19
|
-
outlined:
|
|
20
|
-
voteButtonThesis:
|
|
21
|
-
voteButtonThesisSynthesisMobile:
|
|
19
|
+
outlined: A,
|
|
20
|
+
voteButtonThesis: a,
|
|
21
|
+
voteButtonThesisSynthesisMobile: b,
|
|
22
22
|
voteBoxActionsBodyOutlined: R,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
voteBoxActionsBodyFilledNeutral: g,
|
|
24
|
+
voteActionButton: m,
|
|
25
|
+
sideIcon: w,
|
|
26
|
+
progress: C,
|
|
27
|
+
progressBar: N,
|
|
27
28
|
voteCommentCounts: S,
|
|
28
29
|
debateNumberItem: f,
|
|
29
30
|
debateNumberLabel: I,
|
|
30
31
|
showResultButton: L,
|
|
31
|
-
voteResultInfoText:
|
|
32
|
+
voteResultInfoText: T
|
|
32
33
|
};
|
|
33
34
|
export {
|
|
34
35
|
x as boldShowResult,
|
|
35
|
-
|
|
36
|
+
c as buttonAlignLeft,
|
|
36
37
|
f as debateNumberItem,
|
|
37
38
|
I as debateNumberLabel,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
p as default,
|
|
40
|
+
A as outlined,
|
|
41
|
+
C as progress,
|
|
42
|
+
N as progressBar,
|
|
42
43
|
L as showResultButton,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
w as sideIcon,
|
|
45
|
+
h as textAlignLeft,
|
|
46
|
+
i as voteAction,
|
|
47
|
+
m as voteActionButton,
|
|
47
48
|
o as voteBox,
|
|
48
49
|
v as voteBoxActions,
|
|
49
50
|
B as voteBoxActionsBody,
|
|
50
|
-
|
|
51
|
+
l as voteBoxActionsBodyColumn,
|
|
52
|
+
g as voteBoxActionsBodyFilledNeutral,
|
|
51
53
|
R as voteBoxActionsBodyOutlined,
|
|
52
54
|
u as voteBoxFooter,
|
|
53
55
|
d as voteBoxShowResult,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
y as voteBoxShowResultContainer,
|
|
57
|
+
r as voteButton,
|
|
58
|
+
a as voteButtonThesis,
|
|
59
|
+
b as voteButtonThesisSynthesisMobile,
|
|
58
60
|
S as voteCommentCounts,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
n as voteProgressHeader,
|
|
62
|
+
s as voteProgressHeaderAgainst,
|
|
63
|
+
T as voteResultInfoText,
|
|
62
64
|
e as voteResults,
|
|
63
65
|
t as voteResultsBox,
|
|
64
66
|
_ as voteResultsNumberVoters
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._voteBox_1how7_3{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:100%}._voteResultsBox_1how7_11{display:flex!important;flex-direction:column!important;padding:0!important;width:100%}._voteResults_1how7_11{padding:0!important}._voteProgressHeader_1how7_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_1how7_35{margin-top:var(--spacer-md, calc(var(--space-unit, 1em) * .75))!important}._voteResultsNumberVoters_1how7_39{display:flex!important;align-items:center!important;padding:0!important;font-size:var(--font-size-normal, 16px);color:var(--text-secondary, #5F5F5F)}._voteBoxFooter_1how7_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_1how7_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_1how7_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_1how7_74{grid-template-columns:1fr}._voteAction_1how7_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_1how7_78._buttonAlignLeft_1how7_88{justify-content:flex-start!important}button._voteButton_1how7_92,a._voteButton_1how7_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_1how7_103{justify-content:flex-start!important}._voteBoxShowResultContainer_1how7_107{display:flex!important;flex-direction:row!important;justify-content:center;flex-wrap:wrap!important;margin-top:.3em}._voteBoxShowResult_1how7_107{cursor:pointer}._voteBoxShowResult_1how7_107 a{color:inherit;text-decoration:none;background:none!important}._voteBoxShowResult_1how7_107 a:hover{text-decoration:none;background:none!important}._voteBoxShowResult_1how7_107 a:focus:not(:focus-visible){outline:none;box-shadow:none}._voteBoxShowResult_1how7_107 ._boldShowResult_1how7_131{font-weight:var(--font-weight-bold, 700);font-variation-settings:var(--font-variation-bold, normal);color:var(--text-primary, #222222)}._outlined_1how7_137{padding:7px 15px;border-radius:var(--box-border-radius, 6px);border:1px solid var(--text-primary, #222222)!important;white-space:nowrap}._voteButtonThesis_1how7_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_1how7_156{text-align:center!important}}._voteBoxActionsBody_1how7_66 ._voteAction_1how7_78:first-child ._voteButton_1how7_92,._voteBoxActionsBody_1how7_66 ._voteAction_1how7_78:first-child ._voteButton_1how7_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_1how7_66 ._voteAction_1how7_78:nth-child(2) ._voteButton_1how7_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_1how7_66 ._voteAction_1how7_78:nth-child(2) ._voteButton_1how7_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_1how7_66 ._voteAction_1how7_78:nth-child(3) ._voteButton_1how7_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_1how7_66 ._voteAction_1how7_78:nth-child(3) ._voteButton_1how7_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_1how7_195 ._voteAction_1how7_78:first-child ._voteButton_1how7_92,._voteBoxActionsBodyOutlined_1how7_195 ._voteAction_1how7_78:first-child ._voteButton_1how7_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_1how7_195 ._voteAction_1how7_78:nth-child(2) ._voteButton_1how7_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_1how7_195 ._voteAction_1how7_78:nth-child(2) ._voteButton_1how7_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_1how7_195 ._voteAction_1how7_78:nth-child(3) ._voteButton_1how7_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_1how7_195 ._voteAction_1how7_78:nth-child(3) ._voteButton_1how7_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_1how7_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_1how7_234:focus:not(:focus-visible){outline:none;box-shadow:none}._sideIcon_1how7_250 svg{margin-left:5px;fill:var(--text-primary, #222222)}._progress_1how7_255{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));color:var(--text-secondary, #5F5F5F);height:2.2em}._progressBar_1how7_261{border-radius:var(--button-border-radius, var(--box-border-radius, 6px));height:100%}._voteResults_1how7_11>div:first-child ._progress_1how7_255 ._progressBar_1how7_261{background-color:var(--for-primary-color, #cc6a6d)!important}._voteResults_1how7_11>div:nth-child(2) ._progress_1how7_255 ._progressBar_1how7_261{background-color:var(--against-primary-color, #7980bb)!important}._voteResults_1how7_11 div:nth-child(3) ._progress_1how7_255 ._progressBar_1how7_261{background-color:var(--third-position-color-primary, #9b9b9b)!important}._voteCommentCounts_1how7_278{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_1how7_286{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_1how7_295{white-space:nowrap}._showResultButton_1how7_299{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}._showResultButton_1how7_299:focus:not(:focus-visible){outline:none;box-shadow:none}._voteResultInfoText_1how7_312{font-size:var(--font-size-small, 16px);color:var(--text-secondary, #5F5F5F);text-align:left;width:100%;align-self:flex-start}
|