optimized-react-component-library-xyz123 0.19.14 → 0.19.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +11 -19
- package/dist/index.d.ts +11 -19
- package/dist/index.js +420 -459
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +431 -469
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/darkMode.css +38 -4
- package/src/css/mobileView.css +67 -5
- package/src/css/questions.css +44 -57
- package/src/css/styles.css +75 -23
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
// src/components/layout/ValidationMessage/ValidationMessage.tsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
var ValidationSummary = ({
|
|
4
|
+
validationMessesege,
|
|
5
|
+
validationId,
|
|
6
|
+
activatedLanguage = "sv",
|
|
7
|
+
showValidationSummary = false,
|
|
8
|
+
extraCssClass = ""
|
|
9
|
+
}) => {
|
|
10
|
+
return showValidationSummary && /* @__PURE__ */ jsxs("div", { className: `pts-root-error ${extraCssClass}`, id: validationId, children: [
|
|
11
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
12
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: activatedLanguage === "sv" ? "Valideringsfel" : "Validation error" }),
|
|
13
|
+
/* @__PURE__ */ jsx("span", { className: "errorText", children: validationMessesege })
|
|
14
|
+
] });
|
|
15
|
+
};
|
|
16
|
+
var ValidationMessage_default = ValidationSummary;
|
|
17
|
+
|
|
1
18
|
// src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3
20
|
var InputRadio = ({
|
|
4
21
|
question,
|
|
5
22
|
handleQuestionInputChange,
|
|
6
|
-
showPreview = false
|
|
23
|
+
showPreview = false,
|
|
24
|
+
activatedLanguage = "sv"
|
|
7
25
|
}) => {
|
|
8
|
-
var _a;
|
|
26
|
+
var _a, _b, _c;
|
|
9
27
|
const questionId = `question-${question.id}`;
|
|
10
28
|
const groupId = `radio-group-${question.id}`;
|
|
11
29
|
const errorId = `error-${question.id}`;
|
|
@@ -13,21 +31,22 @@ var InputRadio = ({
|
|
|
13
31
|
const e = { target: { value: event.target.value } };
|
|
14
32
|
handleQuestionInputChange(e, question);
|
|
15
33
|
};
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
console.log("question", question);
|
|
35
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
36
|
+
!showPreview && question.visible && /* @__PURE__ */ jsx2("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ jsxs2(
|
|
18
37
|
"fieldset",
|
|
19
38
|
{
|
|
20
39
|
"aria-required": question.isQuestionMandatory,
|
|
21
40
|
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
22
41
|
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
23
42
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ jsxs2("legend", { id: `label-${groupId}`, children: [
|
|
25
44
|
question.questionLabel,
|
|
26
45
|
" ",
|
|
27
|
-
question.isQuestionMandatory && /* @__PURE__ */
|
|
46
|
+
question.isQuestionMandatory && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
28
47
|
] }),
|
|
29
|
-
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
48
|
+
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsxs2("div", { className: "pts-radio-option", children: [
|
|
49
|
+
/* @__PURE__ */ jsx2(
|
|
31
50
|
"input",
|
|
32
51
|
{
|
|
33
52
|
type: "radio",
|
|
@@ -38,27 +57,31 @@ var InputRadio = ({
|
|
|
38
57
|
onChange: handleInputChange
|
|
39
58
|
}
|
|
40
59
|
),
|
|
41
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ jsx2("label", { htmlFor: `${groupId}-option-${index}`, children: option.label }),
|
|
42
61
|
" "
|
|
43
62
|
] }, index)),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
63
|
+
/* @__PURE__ */ jsx2(
|
|
64
|
+
ValidationMessage_default,
|
|
65
|
+
{
|
|
66
|
+
showValidationSummary: (_b = question.hasValidationError) != null ? _b : false,
|
|
67
|
+
validationId: errorId,
|
|
68
|
+
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
69
|
+
activatedLanguage
|
|
70
|
+
}
|
|
71
|
+
)
|
|
49
72
|
]
|
|
50
73
|
}
|
|
51
74
|
) }),
|
|
52
|
-
showPreview && /* @__PURE__ */
|
|
75
|
+
showPreview && /* @__PURE__ */ jsx2(PreviewRadio, { question })
|
|
53
76
|
] });
|
|
54
77
|
};
|
|
55
78
|
var RadioMultipleStandard_default = InputRadio;
|
|
56
79
|
var PreviewRadio = ({ question }) => {
|
|
57
80
|
var _a, _b;
|
|
58
81
|
const previewId = `preview-${question.id}`;
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
83
|
+
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
84
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx2("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx2(
|
|
62
85
|
"dd",
|
|
63
86
|
{
|
|
64
87
|
className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
|
|
@@ -69,10 +92,10 @@ var PreviewRadio = ({ question }) => {
|
|
|
69
92
|
] });
|
|
70
93
|
};
|
|
71
94
|
|
|
72
|
-
// src/components/input-components/
|
|
95
|
+
// src/components/input-components/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
73
96
|
import { useEffect, useState } from "react";
|
|
74
|
-
import { Fragment as Fragment2, jsx as
|
|
75
|
-
var
|
|
97
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
98
|
+
var MultipleCheckboxes = ({
|
|
76
99
|
question,
|
|
77
100
|
handleQuestionInputChange,
|
|
78
101
|
showPreview = false,
|
|
@@ -80,8 +103,6 @@ var CheckboxGroup = ({
|
|
|
80
103
|
}) => {
|
|
81
104
|
var _a;
|
|
82
105
|
const questionId = `question-${question.id}`;
|
|
83
|
-
const errorId = `error-${question.id}`;
|
|
84
|
-
const groupId = `checkbox-group-${question.id}`;
|
|
85
106
|
const [checkedValues, setCheckedValues] = useState([]);
|
|
86
107
|
useEffect(() => {
|
|
87
108
|
var _a2;
|
|
@@ -89,6 +110,7 @@ var CheckboxGroup = ({
|
|
|
89
110
|
var _a3;
|
|
90
111
|
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
|
|
91
112
|
}).map((option) => option.label)) || [];
|
|
113
|
+
console.log("Initial values:", initialValues);
|
|
92
114
|
setCheckedValues(initialValues);
|
|
93
115
|
}, [question.answer, question.options]);
|
|
94
116
|
const handleInputChange = (event, optionValue) => {
|
|
@@ -102,21 +124,100 @@ var CheckboxGroup = ({
|
|
|
102
124
|
const e = { target: { value: updatedValues.toString() } };
|
|
103
125
|
handleQuestionInputChange(e, question);
|
|
104
126
|
};
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
!showPreview && question.visible && /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
128
|
+
!showPreview && question.visible && /* @__PURE__ */ jsx3("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs3("fieldset", { children: [
|
|
129
|
+
/* @__PURE__ */ jsxs3("legend", { className: "multipleCheckboxes-legend", id: `label-${questionId}`, children: [
|
|
130
|
+
question.questionLabel,
|
|
131
|
+
" ",
|
|
132
|
+
question.isQuestionMandatory && /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
133
|
+
" "
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ jsx3("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
136
|
+
" ",
|
|
137
|
+
/* @__PURE__ */ jsx3(
|
|
138
|
+
"input",
|
|
139
|
+
{
|
|
140
|
+
type: "checkbox",
|
|
141
|
+
name: `${question.id}-option`,
|
|
142
|
+
id: `${question.id}-option-${index}`,
|
|
143
|
+
value: option.label,
|
|
144
|
+
checked: checkedValues.includes(option.label),
|
|
145
|
+
onChange: (e) => handleInputChange(e, option.label),
|
|
146
|
+
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsx3("label", { htmlFor: `${question.id}-option-${index}`, children: option.label })
|
|
150
|
+
] }) }, index)) })
|
|
151
|
+
] }) }),
|
|
152
|
+
" ",
|
|
153
|
+
showPreview && /* @__PURE__ */ jsx3(PrevieMultipleCheckboxes, { activatedLanguage, question })
|
|
154
|
+
] });
|
|
155
|
+
};
|
|
156
|
+
var MultipleCheckboxesStandard_default = MultipleCheckboxes;
|
|
157
|
+
var PrevieMultipleCheckboxes = ({
|
|
158
|
+
question,
|
|
159
|
+
activatedLanguage
|
|
160
|
+
}) => {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const previewId = `preview-${question.id}`;
|
|
163
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
164
|
+
/* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
165
|
+
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx3("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx3("dd", { children: /* @__PURE__ */ jsx3("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
166
|
+
var _a2;
|
|
167
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
168
|
+
}).map((option, index) => /* @__PURE__ */ jsx3("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ jsx3("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
169
|
+
" "
|
|
170
|
+
] });
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// src/components/input-components/CheckboxGroupStandard/CheckboxGroupStandard.tsx
|
|
174
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
175
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
176
|
+
var CheckboxGroup = ({
|
|
177
|
+
question,
|
|
178
|
+
handleQuestionInputChange,
|
|
179
|
+
showPreview = false,
|
|
180
|
+
activatedLanguage = "sv"
|
|
181
|
+
}) => {
|
|
182
|
+
var _a, _b, _c;
|
|
183
|
+
const questionId = `question-${question.id}`;
|
|
184
|
+
const errorId = `error-${question.id}`;
|
|
185
|
+
const groupId = `checkbox-group-${question.id}`;
|
|
186
|
+
const [checkedValues, setCheckedValues] = useState2([]);
|
|
187
|
+
useEffect2(() => {
|
|
188
|
+
var _a2;
|
|
189
|
+
const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
|
|
190
|
+
var _a3;
|
|
191
|
+
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
|
|
192
|
+
}).map((option) => option.label)) || [];
|
|
193
|
+
setCheckedValues(initialValues);
|
|
194
|
+
}, [question.answer, question.options]);
|
|
195
|
+
const handleInputChange = (event, optionValue) => {
|
|
196
|
+
let updatedValues = [...checkedValues];
|
|
197
|
+
if (updatedValues.includes(optionValue)) {
|
|
198
|
+
updatedValues = updatedValues.filter((val) => val !== optionValue);
|
|
199
|
+
} else {
|
|
200
|
+
updatedValues.push(optionValue);
|
|
201
|
+
}
|
|
202
|
+
setCheckedValues(updatedValues);
|
|
203
|
+
const e = { target: { value: updatedValues.toString() } };
|
|
204
|
+
handleQuestionInputChange(e, question);
|
|
205
|
+
};
|
|
206
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
207
|
+
!showPreview && question.visible && /* @__PURE__ */ jsx4("div", { id: questionId, className: "pts-root-question pts-checkboxGroup-container", children: /* @__PURE__ */ jsxs4(
|
|
107
208
|
"fieldset",
|
|
108
209
|
{
|
|
109
210
|
"aria-required": question.isQuestionMandatory,
|
|
110
211
|
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
111
212
|
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
112
213
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ jsxs4("legend", { className: "pts-checkboxGroup-legend", id: `label-${groupId}`, children: [
|
|
114
215
|
question.questionLabel,
|
|
115
216
|
" ",
|
|
116
|
-
question.isQuestionMandatory && /* @__PURE__ */
|
|
217
|
+
question.isQuestionMandatory && /* @__PURE__ */ jsx4("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
117
218
|
] }),
|
|
118
|
-
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
219
|
+
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsxs4("div", { className: "pts-checkboxGroup-options", children: [
|
|
220
|
+
/* @__PURE__ */ jsx4(
|
|
120
221
|
"input",
|
|
121
222
|
{
|
|
122
223
|
type: "checkbox",
|
|
@@ -128,17 +229,21 @@ var CheckboxGroup = ({
|
|
|
128
229
|
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
129
230
|
}
|
|
130
231
|
),
|
|
131
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ jsx4("label", { htmlFor: `${groupId}-option-${index}`, children: option.label })
|
|
132
233
|
] }, index)),
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
234
|
+
/* @__PURE__ */ jsx4(
|
|
235
|
+
ValidationMessage_default,
|
|
236
|
+
{
|
|
237
|
+
showValidationSummary: (_b = question.hasValidationError) != null ? _b : false,
|
|
238
|
+
validationId: errorId,
|
|
239
|
+
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
240
|
+
activatedLanguage
|
|
241
|
+
}
|
|
242
|
+
)
|
|
138
243
|
]
|
|
139
244
|
}
|
|
140
245
|
) }),
|
|
141
|
-
showPreview && /* @__PURE__ */
|
|
246
|
+
showPreview && /* @__PURE__ */ jsx4(PreviewCheckboxGroup, { activatedLanguage, question })
|
|
142
247
|
] });
|
|
143
248
|
};
|
|
144
249
|
var CheckboxGroupStandard_default = CheckboxGroup;
|
|
@@ -148,44 +253,44 @@ var PreviewCheckboxGroup = ({
|
|
|
148
253
|
}) => {
|
|
149
254
|
var _a, _b;
|
|
150
255
|
const previewId = `preview-${question.id}`;
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
257
|
+
/* @__PURE__ */ jsx4("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
258
|
+
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx4("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx4("dd", { children: /* @__PURE__ */ jsx4("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
154
259
|
var _a2;
|
|
155
260
|
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
156
|
-
}).map((option, index) => /* @__PURE__ */
|
|
261
|
+
}).map((option, index) => /* @__PURE__ */ jsx4("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ jsx4("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
157
262
|
" "
|
|
158
263
|
] });
|
|
159
264
|
};
|
|
160
265
|
|
|
161
266
|
// src/components/input-components/TextAreaStandard/TextAreaStandard.tsx
|
|
162
267
|
import DOMPurify from "dompurify";
|
|
163
|
-
import { Fragment as
|
|
268
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
164
269
|
var InputTextarea = ({
|
|
165
270
|
question,
|
|
166
271
|
handleQuestionInputChange,
|
|
167
272
|
showPreview = false,
|
|
168
273
|
activatedLanguage
|
|
169
274
|
}) => {
|
|
170
|
-
var _a, _b, _c, _d, _e;
|
|
275
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
171
276
|
const questionId = `question-${question.id}`;
|
|
172
277
|
const inputId = `textarea-${question.id}`;
|
|
173
278
|
const aboutId = `about-${question.id}`;
|
|
174
279
|
const errorId = `error-${question.id}`;
|
|
175
280
|
const defaultMaxLength = 1e3;
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
!showPreview && question.visible && /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
282
|
+
!showPreview && question.visible && /* @__PURE__ */ jsxs5(
|
|
178
283
|
"div",
|
|
179
284
|
{
|
|
180
285
|
id: questionId,
|
|
181
286
|
className: `pts-root-question pts-textArea-container${question.aboutText ? " pts-question-hasAbout" : ""}`,
|
|
182
287
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ jsxs5("label", { htmlFor: inputId, children: [
|
|
184
289
|
question.questionLabel,
|
|
185
290
|
" ",
|
|
186
|
-
question.isQuestionMandatory && /* @__PURE__ */
|
|
291
|
+
question.isQuestionMandatory && /* @__PURE__ */ jsx5("span", { className: "pts-root-mandatoryAsterisk", "aria-hidden": "true", children: "*" })
|
|
187
292
|
] }),
|
|
188
|
-
question.aboutText && /* @__PURE__ */
|
|
293
|
+
question.aboutText && /* @__PURE__ */ jsx5(
|
|
189
294
|
"div",
|
|
190
295
|
{
|
|
191
296
|
id: aboutId,
|
|
@@ -195,7 +300,7 @@ var InputTextarea = ({
|
|
|
195
300
|
}
|
|
196
301
|
}
|
|
197
302
|
),
|
|
198
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ jsx5(
|
|
199
304
|
"textarea",
|
|
200
305
|
{
|
|
201
306
|
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0,
|
|
@@ -209,20 +314,25 @@ var InputTextarea = ({
|
|
|
209
314
|
id: inputId
|
|
210
315
|
}
|
|
211
316
|
),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
317
|
+
/* @__PURE__ */ jsxs5("div", { className: "pts-textarea-counter-error-container", children: [
|
|
318
|
+
/* @__PURE__ */ jsx5(
|
|
319
|
+
ValidationMessage_default,
|
|
320
|
+
{
|
|
321
|
+
showValidationSummary: (_b = question.hasValidationError) != null ? _b : false,
|
|
322
|
+
validationId: errorId,
|
|
323
|
+
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
324
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
!((_d = question.questionExtraAttribute) == null ? void 0 : _d.hideTextCounter) && /* @__PURE__ */ jsxs5(
|
|
218
328
|
"div",
|
|
219
329
|
{
|
|
220
|
-
className: `pts-character-counter ${question.answer && (((
|
|
330
|
+
className: `pts-character-counter ${question.answer && (((_e = question.questionExtraAttribute) == null ? void 0 : _e.answerMaxLength) || defaultMaxLength) && question.answer.length > (((_f = question.questionExtraAttribute) == null ? void 0 : _f.answerMaxLength) || defaultMaxLength) ? "error" : ""}`,
|
|
221
331
|
children: [
|
|
222
332
|
question.answer ? question.answer.length : 0,
|
|
223
333
|
" av",
|
|
224
334
|
" ",
|
|
225
|
-
((
|
|
335
|
+
((_g = question.questionExtraAttribute) == null ? void 0 : _g.answerMaxLength) || defaultMaxLength,
|
|
226
336
|
" tecken"
|
|
227
337
|
]
|
|
228
338
|
}
|
|
@@ -231,7 +341,7 @@ var InputTextarea = ({
|
|
|
231
341
|
]
|
|
232
342
|
}
|
|
233
343
|
),
|
|
234
|
-
showPreview && /* @__PURE__ */
|
|
344
|
+
showPreview && /* @__PURE__ */ jsx5(PreviewTextarea, { activatedLanguage, question })
|
|
235
345
|
] });
|
|
236
346
|
};
|
|
237
347
|
var TextAreaStandard_default = InputTextarea;
|
|
@@ -241,9 +351,9 @@ var PreviewTextarea = ({
|
|
|
241
351
|
}) => {
|
|
242
352
|
var _a, _b;
|
|
243
353
|
const previewId = `preview-${question.id}`;
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
355
|
+
/* @__PURE__ */ jsx5("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
356
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx5("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx5(
|
|
247
357
|
"dd",
|
|
248
358
|
{
|
|
249
359
|
className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
|
|
@@ -256,32 +366,32 @@ var PreviewTextarea = ({
|
|
|
256
366
|
|
|
257
367
|
// src/components/input-components/TextFieldStandard/TextFieldStandard.tsx
|
|
258
368
|
import DOMPurify2 from "dompurify";
|
|
259
|
-
import { Fragment as
|
|
369
|
+
import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
260
370
|
var TextFieldStandard = ({
|
|
261
371
|
question,
|
|
262
372
|
handleQuestionInputChange,
|
|
263
373
|
showPreview = false,
|
|
264
374
|
activatedLanguage
|
|
265
375
|
}) => {
|
|
266
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
376
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
267
377
|
const questionId = `question-${question.id}`;
|
|
268
378
|
const inputId = `textField-${question.id}`;
|
|
269
379
|
const aboutId = `about-${question.id}`;
|
|
270
380
|
const errorId = `error-${question.id}`;
|
|
271
381
|
const defaultMaxLength = 1e3;
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
!showPreview && question.visible && /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
383
|
+
!showPreview && question.visible && /* @__PURE__ */ jsxs6(
|
|
274
384
|
"div",
|
|
275
385
|
{
|
|
276
386
|
id: questionId,
|
|
277
387
|
className: `pts-root-question pts-textField-container${((_a = question.questionExtraAttribute) == null ? void 0 : _a.disabled) ? " pts-textField-disabled" : ""}${question.aboutText ? " pts-question-hasAbout" : ""}`.trim(),
|
|
278
388
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ jsxs6("label", { htmlFor: inputId, children: [
|
|
280
390
|
question.questionLabel,
|
|
281
391
|
" ",
|
|
282
|
-
question.isQuestionMandatory && /* @__PURE__ */
|
|
392
|
+
question.isQuestionMandatory && /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
283
393
|
] }),
|
|
284
|
-
question.aboutText && /* @__PURE__ */
|
|
394
|
+
question.aboutText && /* @__PURE__ */ jsx6(
|
|
285
395
|
"div",
|
|
286
396
|
{
|
|
287
397
|
id: aboutId,
|
|
@@ -291,7 +401,7 @@ var TextFieldStandard = ({
|
|
|
291
401
|
}
|
|
292
402
|
}
|
|
293
403
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ jsx6(
|
|
295
405
|
"input",
|
|
296
406
|
{
|
|
297
407
|
type: (_c = (_b = question.questionExtraAttribute) == null ? void 0 : _b.inputType) != null ? _c : "text",
|
|
@@ -313,15 +423,24 @@ var TextFieldStandard = ({
|
|
|
313
423
|
autoCapitalize: (_m = (_l = question.questionExtraAttribute) == null ? void 0 : _l.autoCapitalize) != null ? _m : void 0
|
|
314
424
|
}
|
|
315
425
|
),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
426
|
+
/* @__PURE__ */ jsx6(
|
|
427
|
+
ValidationMessage_default,
|
|
428
|
+
{
|
|
429
|
+
showValidationSummary: (_n = question.hasValidationError) != null ? _n : false,
|
|
430
|
+
validationId: errorId,
|
|
431
|
+
validationMessesege: (_o = question.validationDefaultMessesege) != null ? _o : "",
|
|
432
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
question.hasValidationError && /* @__PURE__ */ jsxs6("div", { className: "pts-root-error", id: errorId, children: [
|
|
436
|
+
/* @__PURE__ */ jsx6("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
437
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
438
|
+
/* @__PURE__ */ jsx6("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
320
439
|
] })
|
|
321
440
|
]
|
|
322
441
|
}
|
|
323
442
|
),
|
|
324
|
-
showPreview && /* @__PURE__ */
|
|
443
|
+
showPreview && /* @__PURE__ */ jsx6(PreviewTextField, { activatedLanguage, question })
|
|
325
444
|
] });
|
|
326
445
|
};
|
|
327
446
|
var TextFieldStandard_default = TextFieldStandard;
|
|
@@ -331,9 +450,9 @@ var PreviewTextField = ({
|
|
|
331
450
|
}) => {
|
|
332
451
|
var _a, _b;
|
|
333
452
|
const previewId = `preview-${question.id}`;
|
|
334
|
-
return /* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
454
|
+
/* @__PURE__ */ jsx6("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
455
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx6("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx6(
|
|
337
456
|
"dd",
|
|
338
457
|
{
|
|
339
458
|
className: "pts-textField-preview pts-root-answer no-answer-preview-page",
|
|
@@ -345,12 +464,12 @@ var PreviewTextField = ({
|
|
|
345
464
|
};
|
|
346
465
|
|
|
347
466
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
348
|
-
import { useCallback, useEffect as
|
|
467
|
+
import { useCallback, useEffect as useEffect5, useState as useState5 } from "react";
|
|
349
468
|
import clsx3 from "clsx";
|
|
350
469
|
|
|
351
470
|
// src/components/input-components/AddFilesStandard/DropFilesStandard.tsx
|
|
352
471
|
import { useDropzone } from "react-dropzone";
|
|
353
|
-
import { Fragment as
|
|
472
|
+
import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
354
473
|
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
|
|
355
474
|
const onDrop = FilesSelected;
|
|
356
475
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, noKeyboard: true });
|
|
@@ -358,10 +477,10 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
358
477
|
event.preventDefault();
|
|
359
478
|
event.stopPropagation();
|
|
360
479
|
};
|
|
361
|
-
return /* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ jsx7(Fragment6, { children: /* @__PURE__ */ jsx7("div", { className: "DropZoneContainer", children: /* @__PURE__ */ jsxs7("div", { className: "DropZone", ...getRootProps(), onClick: handleFileExplorer, children: [
|
|
481
|
+
/* @__PURE__ */ jsxs7("label", { htmlFor: "fileDropInput", hidden: true, children: [
|
|
363
482
|
"Dra och sl\xE4pp filer h\xE4r omr\xE5de",
|
|
364
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ jsx7(
|
|
365
484
|
"input",
|
|
366
485
|
{
|
|
367
486
|
...getInputProps({
|
|
@@ -372,8 +491,8 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
372
491
|
}
|
|
373
492
|
)
|
|
374
493
|
] }),
|
|
375
|
-
isDragActive ? /* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
494
|
+
isDragActive ? /* @__PURE__ */ jsx7("b", { className: "dropFilesNowText", children: language === "sv" ? "Sl\xE4pp filerna, nu ...!" : "Drop files here!" }) : /* @__PURE__ */ jsxs7("div", { className: "DropZone-label-container", children: [
|
|
495
|
+
/* @__PURE__ */ jsx7(
|
|
377
496
|
"svg",
|
|
378
497
|
{
|
|
379
498
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -381,7 +500,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
381
500
|
height: "2.4rem",
|
|
382
501
|
viewBox: "0 0 7 15",
|
|
383
502
|
fill: "#fff",
|
|
384
|
-
children: /* @__PURE__ */
|
|
503
|
+
children: /* @__PURE__ */ jsx7(
|
|
385
504
|
"path",
|
|
386
505
|
{
|
|
387
506
|
d: "M0 2.5C0 1.83696 0.263392 1.20107 0.732233 0.732233C1.20107 0.263392 1.83696 0 2.5 0C3.16304 0 3.79893 0.263392 4.26777 0.732233C4.73661 1.20107 5 1.83696 5 2.5V11.5C5 11.8978 4.84196 12.2794 4.56066 12.5607C4.27936 12.842 3.89782 13 3.5 13C3.10218 13 2.72064 12.842 2.43934 12.5607C2.15804 12.2794 2 11.8978 2 11.5V4.5C2 4.36739 2.05268 4.24021 2.14645 4.14645C2.24021 4.05268 2.36739 4 2.5 4C2.63261 4 2.75979 4.05268 2.85355 4.14645C2.94732 4.24021 3 4.36739 3 4.5V11.5C3 11.6326 3.05268 11.7598 3.14645 11.8536C3.24021 11.9473 3.36739 12 3.5 12C3.63261 12 3.75979 11.9473 3.85355 11.8536C3.94732 11.7598 4 11.6326 4 11.5V2.5C4 2.30302 3.9612 2.10796 3.88582 1.92597C3.81044 1.74399 3.69995 1.57863 3.56066 1.43934C3.42137 1.30005 3.25601 1.18956 3.07403 1.11418C2.89204 1.0388 2.69698 1 2.5 1C2.30302 1 2.10796 1.0388 1.92597 1.11418C1.74399 1.18956 1.57863 1.30005 1.43934 1.43934C1.30005 1.57863 1.18956 1.74399 1.11418 1.92597C1.0388 2.10796 1 2.30302 1 2.5V11.5C1 12.163 1.26339 12.7989 1.73223 13.2678C2.20107 13.7366 2.83696 14 3.5 14C4.16304 14 4.79893 13.7366 5.26777 13.2678C5.73661 12.7989 6 12.163 6 11.5V4.5C6 4.36739 6.05268 4.24021 6.14645 4.14645C6.24021 4.05268 6.36739 4 6.5 4C6.63261 4 6.75979 4.05268 6.85355 4.14645C6.94732 4.24021 7 4.36739 7 4.5V11.5C7 12.4283 6.63125 13.3185 5.97487 13.9749C5.3185 14.6313 4.42826 15 3.5 15C2.57174 15 1.6815 14.6313 1.02513 13.9749C0.368749 13.3185 0 12.4283 0 11.5V2.5Z",
|
|
@@ -390,7 +509,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
390
509
|
)
|
|
391
510
|
}
|
|
392
511
|
),
|
|
393
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ jsx7("p", { className: "dropFilesText", children: DropFilesText })
|
|
394
513
|
] })
|
|
395
514
|
] }) }) });
|
|
396
515
|
};
|
|
@@ -402,7 +521,7 @@ import clsx from "clsx";
|
|
|
402
521
|
|
|
403
522
|
// src/components/input-components/AddFilesStandard/ScreenReaderErrors.tsx
|
|
404
523
|
import React from "react";
|
|
405
|
-
import { Fragment as
|
|
524
|
+
import { Fragment as Fragment7, jsx as jsx8 } from "react/jsx-runtime";
|
|
406
525
|
var ScreenReaderErrors = ({
|
|
407
526
|
errorMessageAddingFile,
|
|
408
527
|
activatedLanguage
|
|
@@ -421,12 +540,12 @@ var ScreenReaderErrors = ({
|
|
|
421
540
|
setActivateErrorMessagesForScreenReader(true);
|
|
422
541
|
}
|
|
423
542
|
}, [errorMessageAddingFile]);
|
|
424
|
-
return /* @__PURE__ */
|
|
543
|
+
return /* @__PURE__ */ jsx8(Fragment7, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx8("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
|
|
425
544
|
};
|
|
426
545
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
427
546
|
|
|
428
547
|
// src/components/input-components/AddFilesStandard/ExploreFilesStandard.tsx
|
|
429
|
-
import { Fragment as
|
|
548
|
+
import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
430
549
|
var ExploreFiles = ({
|
|
431
550
|
FilesSelected,
|
|
432
551
|
numberOfFiles,
|
|
@@ -453,8 +572,8 @@ var ExploreFiles = ({
|
|
|
453
572
|
};
|
|
454
573
|
let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
|
|
455
574
|
const ariaLabelText = `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`;
|
|
456
|
-
return /* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
575
|
+
return /* @__PURE__ */ jsx9(Fragment8, { children: /* @__PURE__ */ jsxs8("div", { className: "inputContainer", children: [
|
|
576
|
+
/* @__PURE__ */ jsxs8(
|
|
458
577
|
"div",
|
|
459
578
|
{
|
|
460
579
|
className: clsx(
|
|
@@ -464,7 +583,7 @@ var ExploreFiles = ({
|
|
|
464
583
|
),
|
|
465
584
|
id: labelId,
|
|
466
585
|
children: [
|
|
467
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ jsx9(
|
|
468
587
|
"button",
|
|
469
588
|
{
|
|
470
589
|
ref: buttonInputRef,
|
|
@@ -479,12 +598,12 @@ var ExploreFiles = ({
|
|
|
479
598
|
children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
|
|
480
599
|
}
|
|
481
600
|
),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ jsx9("span", { "aria-hidden": true, className: "filePickText", children: addFilesInfoText }),
|
|
602
|
+
/* @__PURE__ */ jsx9("label", { htmlFor: inputId, "aria-hidden": true, className: "invisible" })
|
|
484
603
|
]
|
|
485
604
|
}
|
|
486
605
|
),
|
|
487
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ jsx9(
|
|
488
607
|
"input",
|
|
489
608
|
{
|
|
490
609
|
"aria-hidden": true,
|
|
@@ -497,7 +616,7 @@ var ExploreFiles = ({
|
|
|
497
616
|
id: inputId
|
|
498
617
|
}
|
|
499
618
|
),
|
|
500
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ jsx9(
|
|
501
620
|
ScreenReaderErrors_default,
|
|
502
621
|
{
|
|
503
622
|
errorMessageAddingFile,
|
|
@@ -509,22 +628,22 @@ var ExploreFiles = ({
|
|
|
509
628
|
var ExploreFilesStandard_default = ExploreFiles;
|
|
510
629
|
|
|
511
630
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
512
|
-
import React4, { useEffect as
|
|
631
|
+
import React4, { useEffect as useEffect4, useState as useState4, useRef as useRef2 } from "react";
|
|
513
632
|
import { Col, Row } from "react-bootstrap";
|
|
514
633
|
|
|
515
634
|
// src/components/input-components/AddFilesStandard/IndicatorStandard.tsx
|
|
516
|
-
import { useState as
|
|
635
|
+
import { useState as useState3 } from "react";
|
|
517
636
|
import clsx2 from "clsx";
|
|
518
|
-
import { Fragment as
|
|
637
|
+
import { Fragment as Fragment9, jsx as jsx10 } from "react/jsx-runtime";
|
|
519
638
|
var Indicator = (filename) => {
|
|
520
|
-
const [uploadPercentage, setUploadPercentage] =
|
|
521
|
-
const [uploadDone, setUploadDone] =
|
|
522
|
-
return /* @__PURE__ */
|
|
639
|
+
const [uploadPercentage, setUploadPercentage] = useState3(0);
|
|
640
|
+
const [uploadDone, setUploadDone] = useState3(false);
|
|
641
|
+
return /* @__PURE__ */ jsx10(Fragment9, { children: /* @__PURE__ */ jsx10("div", { className: clsx2("uploadIndicator", "uploadDone") }) });
|
|
523
642
|
};
|
|
524
643
|
var IndicatorStandard_default = Indicator;
|
|
525
644
|
|
|
526
645
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
527
|
-
import { Fragment as
|
|
646
|
+
import { Fragment as Fragment10, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
528
647
|
var SelectedFiles = ({
|
|
529
648
|
questionObject,
|
|
530
649
|
isTouched,
|
|
@@ -546,13 +665,13 @@ var SelectedFiles = ({
|
|
|
546
665
|
isTouched(e, questionObject);
|
|
547
666
|
removeFile(newCountOfFiles);
|
|
548
667
|
};
|
|
549
|
-
|
|
668
|
+
useEffect4(() => {
|
|
550
669
|
var _a;
|
|
551
670
|
numberOfFiles > 0 && ((_a = theDiv.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "end" }));
|
|
552
671
|
}, [numberOfFiles]);
|
|
553
672
|
const useWindowWidth = () => {
|
|
554
|
-
const [windowWidth2, setWindowWidth] =
|
|
555
|
-
|
|
673
|
+
const [windowWidth2, setWindowWidth] = useState4(window.innerWidth);
|
|
674
|
+
useEffect4(() => {
|
|
556
675
|
const handleResize = () => {
|
|
557
676
|
setWindowWidth(window.innerWidth);
|
|
558
677
|
};
|
|
@@ -564,10 +683,10 @@ var SelectedFiles = ({
|
|
|
564
683
|
return windowWidth2;
|
|
565
684
|
};
|
|
566
685
|
const windowWidth = useWindowWidth();
|
|
567
|
-
return /* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
687
|
+
/* @__PURE__ */ jsx11("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "pts-errorSummary-container pts-addFile-error-container", children: [
|
|
688
|
+
/* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
689
|
+
/* @__PURE__ */ jsx11("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ jsxs9("ul", { "aria-hidden": true, className: "fileListUnorderedList", id: "errorSummary-ul", children: [
|
|
571
690
|
" ",
|
|
572
691
|
errorMessageAddingFile.map((errorObj, index) => {
|
|
573
692
|
const errorFileName = errorObj.FileName;
|
|
@@ -575,9 +694,9 @@ var SelectedFiles = ({
|
|
|
575
694
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
576
695
|
const fileType = errorObj.FileName.split(".").pop();
|
|
577
696
|
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
578
|
-
return /* @__PURE__ */
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(React4.Fragment, { children: /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
|
|
698
|
+
/* @__PURE__ */ jsx11(Row, { children: /* @__PURE__ */ jsx11(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx11("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx11("span", { className: "desktopFileName", children: errorObj.FileName }) }) }),
|
|
699
|
+
/* @__PURE__ */ jsx11(Row, { children: /* @__PURE__ */ jsx11(
|
|
581
700
|
Col,
|
|
582
701
|
{
|
|
583
702
|
className: "errorMessageAddingFile",
|
|
@@ -592,7 +711,7 @@ var SelectedFiles = ({
|
|
|
592
711
|
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
593
712
|
})
|
|
594
713
|
] }) }),
|
|
595
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsx11("div", { className: "addFile-error-close-button", children: /* @__PURE__ */ jsx11(
|
|
596
715
|
"button",
|
|
597
716
|
{
|
|
598
717
|
className: "selectedFilesLinkButton error-close",
|
|
@@ -600,7 +719,7 @@ var SelectedFiles = ({
|
|
|
600
719
|
removeError();
|
|
601
720
|
},
|
|
602
721
|
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelande` : `Close error message`,
|
|
603
|
-
children: /* @__PURE__ */
|
|
722
|
+
children: /* @__PURE__ */ jsx11(
|
|
604
723
|
"svg",
|
|
605
724
|
{
|
|
606
725
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -608,7 +727,7 @@ var SelectedFiles = ({
|
|
|
608
727
|
height: "14",
|
|
609
728
|
viewBox: "0 0 14 14",
|
|
610
729
|
fill: "none",
|
|
611
|
-
children: /* @__PURE__ */
|
|
730
|
+
children: /* @__PURE__ */ jsx11(
|
|
612
731
|
"path",
|
|
613
732
|
{
|
|
614
733
|
d: "M0.75 12.75L12.75 0.75M0.75 0.75L12.75 12.75",
|
|
@@ -622,15 +741,15 @@ var SelectedFiles = ({
|
|
|
622
741
|
}
|
|
623
742
|
) })
|
|
624
743
|
] }) }),
|
|
625
|
-
questionObject.files.length > 0 && /* @__PURE__ */
|
|
744
|
+
questionObject.files.length > 0 && /* @__PURE__ */ jsx11("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
626
745
|
const indicatorfileName = file.FileName;
|
|
627
746
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
628
747
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
629
748
|
const fileType = file.FileName.split(".").pop();
|
|
630
749
|
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(React4.Fragment, { children: /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
|
|
751
|
+
/* @__PURE__ */ jsxs9("div", { className: "fileItem", children: [
|
|
752
|
+
/* @__PURE__ */ jsx11(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: "uploadedDot", children: /* @__PURE__ */ jsx11(
|
|
634
753
|
"svg",
|
|
635
754
|
{
|
|
636
755
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -638,7 +757,7 @@ var SelectedFiles = ({
|
|
|
638
757
|
height: "8",
|
|
639
758
|
viewBox: "0 0 8 8",
|
|
640
759
|
fill: "none",
|
|
641
|
-
children: /* @__PURE__ */
|
|
760
|
+
children: /* @__PURE__ */ jsx11(
|
|
642
761
|
"path",
|
|
643
762
|
{
|
|
644
763
|
d: "M1 4.65913L2.8 6.45913L7 1.35913",
|
|
@@ -649,20 +768,20 @@ var SelectedFiles = ({
|
|
|
649
768
|
)
|
|
650
769
|
}
|
|
651
770
|
) }) }),
|
|
652
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ jsx11(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsxs9("span", { className: "mobileFirstFileName", children: [
|
|
653
772
|
mobileFirstFileName,
|
|
654
773
|
" (",
|
|
655
774
|
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
656
775
|
" ",
|
|
657
776
|
"MB)"
|
|
658
|
-
] }) : /* @__PURE__ */
|
|
777
|
+
] }) : /* @__PURE__ */ jsxs9("span", { className: "desktopFileName", children: [
|
|
659
778
|
file.FileName,
|
|
660
779
|
" (",
|
|
661
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ jsx11("span", { className: "fileSizeText", children: file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB` }),
|
|
662
781
|
" ",
|
|
663
782
|
")"
|
|
664
783
|
] }) }),
|
|
665
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ jsx11(Col, { className: "lastCol", children: /* @__PURE__ */ jsx11(
|
|
666
785
|
"button",
|
|
667
786
|
{
|
|
668
787
|
className: "selectedFilesLinkButton",
|
|
@@ -672,17 +791,17 @@ var SelectedFiles = ({
|
|
|
672
791
|
}
|
|
673
792
|
) })
|
|
674
793
|
] }),
|
|
675
|
-
showIndicator && /* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
794
|
+
showIndicator && /* @__PURE__ */ jsx11(Row, { children: /* @__PURE__ */ jsx11(Col, { style: { width: "100%", padding: 0 }, children: /* @__PURE__ */ jsx11(IndicatorStandard_default, { filename: indicatorfileName }) }) }),
|
|
795
|
+
/* @__PURE__ */ jsx11(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx11(Col, { className: "makeSpace" }) })
|
|
677
796
|
] }, index) }) }) }, `file-${file.FileName}-${index}`) });
|
|
678
797
|
}) }),
|
|
679
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ jsx11("div", { ref: theDiv, className: "pts-clipboard-container" })
|
|
680
799
|
] });
|
|
681
800
|
};
|
|
682
801
|
var SelectedFilesStandard_default = SelectedFiles;
|
|
683
802
|
|
|
684
803
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
685
|
-
import { Fragment as
|
|
804
|
+
import { Fragment as Fragment11, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
686
805
|
var AddFiles = ({
|
|
687
806
|
questionObject,
|
|
688
807
|
handleQuestionInputChange = (e, questionObject2) => {
|
|
@@ -696,6 +815,7 @@ var AddFiles = ({
|
|
|
696
815
|
allowedTotalFileSize = 20971520
|
|
697
816
|
// 20MB = (1024 * 1024) * 20
|
|
698
817
|
}) => {
|
|
818
|
+
var _a, _b;
|
|
699
819
|
if (allowedFileTypes.length < 1) {
|
|
700
820
|
allowedFileTypes = [
|
|
701
821
|
"pdf",
|
|
@@ -720,26 +840,26 @@ var AddFiles = ({
|
|
|
720
840
|
const errorId = `error-${questionObject.id}`;
|
|
721
841
|
const labelId = `label-${questionObject.id}`;
|
|
722
842
|
const maxSizeMB = Math.round(allowedTotalFileSize / 1048576);
|
|
723
|
-
const [numberOfFiles, setNumberOfFiles] =
|
|
724
|
-
const [totalFileSize, setTotalFileSize] =
|
|
725
|
-
const [errorMessageAddingFile, setErrorMessageAddingFile] =
|
|
726
|
-
const [newFiles, setNewFiles] =
|
|
727
|
-
const [dropFilesText, setDropFilesText] =
|
|
728
|
-
|
|
843
|
+
const [numberOfFiles, setNumberOfFiles] = useState5(0);
|
|
844
|
+
const [totalFileSize, setTotalFileSize] = useState5(0);
|
|
845
|
+
const [errorMessageAddingFile, setErrorMessageAddingFile] = useState5([]);
|
|
846
|
+
const [newFiles, setNewFiles] = useState5([]);
|
|
847
|
+
const [dropFilesText, setDropFilesText] = useState5("Dra och sl\xE4pp dina filer h\xE4r");
|
|
848
|
+
useEffect5(() => {
|
|
729
849
|
if (activatedLanguage === "sv") {
|
|
730
850
|
setDropFilesText("Dra och sl\xE4pp dina filer h\xE4r");
|
|
731
851
|
} else {
|
|
732
852
|
setDropFilesText("Drag and drop your files here");
|
|
733
853
|
}
|
|
734
854
|
}, [activatedLanguage]);
|
|
735
|
-
|
|
855
|
+
useEffect5(() => {
|
|
736
856
|
if (questionObject.files && questionObject.files.length > 0) {
|
|
737
857
|
setNumberOfFiles(questionObject.files.length);
|
|
738
858
|
}
|
|
739
859
|
}, []);
|
|
740
860
|
const onDrop = useCallback(
|
|
741
861
|
(acceptedFiles) => {
|
|
742
|
-
var
|
|
862
|
+
var _a2, _b2, _c;
|
|
743
863
|
const validationErrors = [];
|
|
744
864
|
const validFiles = [];
|
|
745
865
|
const currentTotalFileSize = (questionObject.files || []).reduce(
|
|
@@ -747,7 +867,7 @@ var AddFiles = ({
|
|
|
747
867
|
0
|
|
748
868
|
);
|
|
749
869
|
setTotalFileSize(currentTotalFileSize);
|
|
750
|
-
if ((((
|
|
870
|
+
if ((((_a2 = questionObject.files) == null ? void 0 : _a2.length) || 0) >= allowedNumberOfFiles) {
|
|
751
871
|
acceptedFiles.forEach((file) => {
|
|
752
872
|
validationErrors.push({
|
|
753
873
|
FileName: file.name,
|
|
@@ -760,7 +880,7 @@ var AddFiles = ({
|
|
|
760
880
|
}
|
|
761
881
|
let accumulatedNewSize = 0;
|
|
762
882
|
for (const file of acceptedFiles) {
|
|
763
|
-
const fileExtension = ((
|
|
883
|
+
const fileExtension = ((_b2 = file.name.split(".").pop()) == null ? void 0 : _b2.toLowerCase()) || "";
|
|
764
884
|
if (!allowedFileTypes.includes(fileExtension)) {
|
|
765
885
|
validationErrors.push({
|
|
766
886
|
FileName: file.name,
|
|
@@ -827,7 +947,7 @@ var AddFiles = ({
|
|
|
827
947
|
reader.readAsDataURL(file);
|
|
828
948
|
});
|
|
829
949
|
};
|
|
830
|
-
|
|
950
|
+
useEffect5(() => {
|
|
831
951
|
if (newFiles.length > 0) {
|
|
832
952
|
const currentFiles = questionObject.files ? questionObject.files : [];
|
|
833
953
|
const e = {
|
|
@@ -854,9 +974,9 @@ var AddFiles = ({
|
|
|
854
974
|
const handleRemoveErrors = () => {
|
|
855
975
|
setErrorMessageAddingFile([]);
|
|
856
976
|
};
|
|
857
|
-
return /* @__PURE__ */
|
|
858
|
-
!showPreview && visible && /* @__PURE__ */
|
|
859
|
-
questionObject.aboutText && /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
978
|
+
!showPreview && visible && /* @__PURE__ */ jsx12("div", { className: "root-question addFile-question-container", id: `question-${questionObject.id}`, children: /* @__PURE__ */ jsxs10("div", { role: "group", children: [
|
|
979
|
+
questionObject.aboutText && /* @__PURE__ */ jsxs10(
|
|
860
980
|
"p",
|
|
861
981
|
{
|
|
862
982
|
id: aboutId,
|
|
@@ -866,19 +986,29 @@ var AddFiles = ({
|
|
|
866
986
|
),
|
|
867
987
|
children: [
|
|
868
988
|
questionObject.aboutText,
|
|
869
|
-
questionObject.isQuestionMandatory && /* @__PURE__ */
|
|
989
|
+
questionObject.isQuestionMandatory && /* @__PURE__ */ jsxs10("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
|
|
870
990
|
" ",
|
|
871
991
|
"*"
|
|
872
992
|
] })
|
|
873
993
|
]
|
|
874
994
|
}
|
|
875
995
|
),
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
996
|
+
/* @__PURE__ */ jsx12(
|
|
997
|
+
ValidationMessage_default,
|
|
998
|
+
{
|
|
999
|
+
showValidationSummary: (_a = questionObject.hasValidationError) != null ? _a : false,
|
|
1000
|
+
validationId: errorId,
|
|
1001
|
+
validationMessesege: (_b = questionObject.validationDefaultMessesege) != null ? _b : "",
|
|
1002
|
+
activatedLanguage,
|
|
1003
|
+
extraCssClass: "error addfileserror"
|
|
1004
|
+
}
|
|
1005
|
+
),
|
|
1006
|
+
questionObject.hasValidationError && /* @__PURE__ */ jsxs10("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
|
|
1007
|
+
/* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1008
|
+
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1009
|
+
/* @__PURE__ */ jsx12("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
|
|
880
1010
|
] }),
|
|
881
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ jsx12(
|
|
882
1012
|
ExploreFilesStandard_default,
|
|
883
1013
|
{
|
|
884
1014
|
FilesSelected: onDrop,
|
|
@@ -894,7 +1024,7 @@ var AddFiles = ({
|
|
|
894
1024
|
removeUploadErrors: handleRemoveErrors
|
|
895
1025
|
}
|
|
896
1026
|
),
|
|
897
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ jsx12(
|
|
898
1028
|
DropFilesStandard_default,
|
|
899
1029
|
{
|
|
900
1030
|
FilesSelected: onDrop,
|
|
@@ -902,7 +1032,7 @@ var AddFiles = ({
|
|
|
902
1032
|
language: activatedLanguage
|
|
903
1033
|
}
|
|
904
1034
|
),
|
|
905
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ jsx12(
|
|
906
1036
|
SelectedFilesStandard_default,
|
|
907
1037
|
{
|
|
908
1038
|
questionObject,
|
|
@@ -917,7 +1047,7 @@ var AddFiles = ({
|
|
|
917
1047
|
}
|
|
918
1048
|
)
|
|
919
1049
|
] }) }),
|
|
920
|
-
showPreview && /* @__PURE__ */
|
|
1050
|
+
showPreview && /* @__PURE__ */ jsx12(PreviewAddFiles, { activatedLanguage, questionObject })
|
|
921
1051
|
] });
|
|
922
1052
|
};
|
|
923
1053
|
var AddFilesStandard_default = AddFiles;
|
|
@@ -926,30 +1056,30 @@ var PreviewAddFiles = ({
|
|
|
926
1056
|
activatedLanguage
|
|
927
1057
|
}) => {
|
|
928
1058
|
const previewId = `preview-${questionObject.Id}`;
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
questionObject.files && questionObject.files.length > 0 ? /* @__PURE__ */
|
|
932
|
-
return /* @__PURE__ */
|
|
933
|
-
}) }) }) : /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
1060
|
+
/* @__PURE__ */ jsx12("dt", { id: `question-${previewId}`, children: questionObject.questionLabel ? questionObject.questionLabel : activatedLanguage === "en" ? "Attached files" : "Bifogade filer" }),
|
|
1061
|
+
questionObject.files && questionObject.files.length > 0 ? /* @__PURE__ */ jsx12("dd", { className: "pts-addFiles-answer", children: /* @__PURE__ */ jsx12("ul", { "aria-labelledby": previewId, className: "pts-preview-answer-list", children: questionObject.files.map((file, index) => {
|
|
1062
|
+
return /* @__PURE__ */ jsx12("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
|
|
1063
|
+
}) }) }) : /* @__PURE__ */ jsx12("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No attached files" : "Inga bifogade filer" })
|
|
934
1064
|
] });
|
|
935
1065
|
};
|
|
936
1066
|
|
|
937
1067
|
// src/components/input-components/SingleCheckboxStandard/SingleCheckboxStandard.tsx
|
|
938
|
-
import { useEffect as
|
|
939
|
-
import { Fragment as
|
|
1068
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1069
|
+
import { Fragment as Fragment12, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
940
1070
|
var SingleCheckbox = ({
|
|
941
1071
|
question,
|
|
942
1072
|
handleQuestionInputChange,
|
|
943
1073
|
showPreview = false,
|
|
944
1074
|
activatedLanguage = "sv"
|
|
945
1075
|
}) => {
|
|
946
|
-
var _a, _b;
|
|
1076
|
+
var _a, _b, _c, _d;
|
|
947
1077
|
const questionId = `question-${question.id}`;
|
|
948
1078
|
const inputId = `checkbox-${question.id}`;
|
|
949
1079
|
const aboutId = `about-${question.id}`;
|
|
950
1080
|
const errorId = `error-${question.id}`;
|
|
951
|
-
const [checked, setChecked] =
|
|
952
|
-
|
|
1081
|
+
const [checked, setChecked] = useState6(false);
|
|
1082
|
+
useEffect6(() => {
|
|
953
1083
|
if (question.answer && question.answer === "true") {
|
|
954
1084
|
setChecked(true);
|
|
955
1085
|
} else {
|
|
@@ -962,10 +1092,10 @@ var SingleCheckbox = ({
|
|
|
962
1092
|
const e = { target: { value: answer } };
|
|
963
1093
|
handleQuestionInputChange(e, question);
|
|
964
1094
|
};
|
|
965
|
-
return /* @__PURE__ */
|
|
966
|
-
!showPreview && question.visible && /* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
1095
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1096
|
+
!showPreview && question.visible && /* @__PURE__ */ jsxs11("div", { id: questionId, className: "pts-root-question pts-singleCheckbox-container", children: [
|
|
1097
|
+
/* @__PURE__ */ jsxs11("div", { className: "pts-singleCheckbox-row", children: [
|
|
1098
|
+
/* @__PURE__ */ jsx13(
|
|
969
1099
|
"input",
|
|
970
1100
|
{
|
|
971
1101
|
type: "checkbox",
|
|
@@ -983,11 +1113,11 @@ var SingleCheckbox = ({
|
|
|
983
1113
|
"aria-errormessage": question.hasValidationError ? errorId : void 0
|
|
984
1114
|
}
|
|
985
1115
|
),
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
question.isQuestionMandatory && /* @__PURE__ */
|
|
1116
|
+
/* @__PURE__ */ jsx13("label", { htmlFor: `${inputId}`, children: question.questionLabel }),
|
|
1117
|
+
question.isQuestionMandatory && /* @__PURE__ */ jsx13("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
988
1118
|
" "
|
|
989
1119
|
] }),
|
|
990
|
-
question.aboutText && /* @__PURE__ */
|
|
1120
|
+
question.aboutText && /* @__PURE__ */ jsx13(
|
|
991
1121
|
"div",
|
|
992
1122
|
{
|
|
993
1123
|
id: aboutId,
|
|
@@ -996,15 +1126,18 @@ var SingleCheckbox = ({
|
|
|
996
1126
|
}
|
|
997
1127
|
),
|
|
998
1128
|
" ",
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1129
|
+
/* @__PURE__ */ jsx13(
|
|
1130
|
+
ValidationMessage_default,
|
|
1131
|
+
{
|
|
1132
|
+
showValidationSummary: (_c = question.hasValidationError) != null ? _c : false,
|
|
1133
|
+
validationId: errorId,
|
|
1134
|
+
validationMessesege: (_d = question.validationDefaultMessesege) != null ? _d : "",
|
|
1135
|
+
activatedLanguage
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1005
1138
|
] }),
|
|
1006
1139
|
" ",
|
|
1007
|
-
showPreview && /* @__PURE__ */
|
|
1140
|
+
showPreview && /* @__PURE__ */ jsx13(PreviewSingleCheckbox, { activatedLanguage, question })
|
|
1008
1141
|
] });
|
|
1009
1142
|
};
|
|
1010
1143
|
var SingleCheckboxStandard_default = SingleCheckbox;
|
|
@@ -1014,9 +1147,9 @@ var PreviewSingleCheckbox = ({
|
|
|
1014
1147
|
}) => {
|
|
1015
1148
|
var _a, _b;
|
|
1016
1149
|
const previewId = `preview-${question.id}`;
|
|
1017
|
-
return /* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1151
|
+
/* @__PURE__ */ jsx13("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1152
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx13("dd", { className: "pts-singleCheckbox-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer === "false" ? activatedLanguage === "sv" ? "Nej" : "No" : activatedLanguage === "sv" ? "Ja" : "Yes" }) : /* @__PURE__ */ jsx13(
|
|
1020
1153
|
"dd",
|
|
1021
1154
|
{
|
|
1022
1155
|
className: "pts-singleCheckbox-preview pts-root-answer",
|
|
@@ -1027,154 +1160,6 @@ var PreviewSingleCheckbox = ({
|
|
|
1027
1160
|
] });
|
|
1028
1161
|
};
|
|
1029
1162
|
|
|
1030
|
-
// src/components/input-components/DropdownStandard/DropdownStandard.tsx
|
|
1031
|
-
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1032
|
-
var CustomDropdownStandard = ({
|
|
1033
|
-
question,
|
|
1034
|
-
handleQuestionInputChange,
|
|
1035
|
-
showPreview = false
|
|
1036
|
-
}) => {
|
|
1037
|
-
var _a;
|
|
1038
|
-
const questionId = `question-${question.id}`;
|
|
1039
|
-
const selectId = `select-${question.id}`;
|
|
1040
|
-
const errorId = `error-${question.id}`;
|
|
1041
|
-
const handleInputChange = (event) => {
|
|
1042
|
-
const e = { target: { value: event.target.value } };
|
|
1043
|
-
handleQuestionInputChange(e, question);
|
|
1044
|
-
};
|
|
1045
|
-
return /* @__PURE__ */ jsxs10(Fragment12, { children: [
|
|
1046
|
-
!showPreview && question.visible && /* @__PURE__ */ jsxs10("div", { className: "pts-root-question pts-dropdown-container", id: questionId, children: [
|
|
1047
|
-
/* @__PURE__ */ jsxs10("label", { htmlFor: selectId, children: [
|
|
1048
|
-
question.questionLabel,
|
|
1049
|
-
" ",
|
|
1050
|
-
question.isQuestionMandatory && /* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
1051
|
-
] }),
|
|
1052
|
-
/* @__PURE__ */ jsxs10(
|
|
1053
|
-
"select",
|
|
1054
|
-
{
|
|
1055
|
-
id: selectId,
|
|
1056
|
-
name: `name-${question.id}`,
|
|
1057
|
-
value: question.answer || "",
|
|
1058
|
-
onChange: handleInputChange,
|
|
1059
|
-
"aria-required": question.isQuestionMandatory,
|
|
1060
|
-
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
1061
|
-
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
1062
|
-
children: [
|
|
1063
|
-
/* @__PURE__ */ jsx12("option", { value: "", children: "V\xE4lj ett alternativ" }),
|
|
1064
|
-
(_a = question.options) == null ? void 0 : _a.map((option, index) => {
|
|
1065
|
-
if (option.value === question.answer) {
|
|
1066
|
-
return /* @__PURE__ */ jsx12("option", { value: option.value, selected: true, children: option.label }, index);
|
|
1067
|
-
} else {
|
|
1068
|
-
return /* @__PURE__ */ jsx12("option", { value: option.value, children: option.label }, index);
|
|
1069
|
-
}
|
|
1070
|
-
})
|
|
1071
|
-
]
|
|
1072
|
-
}
|
|
1073
|
-
),
|
|
1074
|
-
question.hasValidationError && /* @__PURE__ */ jsxs10("div", { className: "pts-root-error", id: errorId, children: [
|
|
1075
|
-
/* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1076
|
-
/* @__PURE__ */ jsx12("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1077
|
-
/* @__PURE__ */ jsx12("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
1078
|
-
] })
|
|
1079
|
-
] }),
|
|
1080
|
-
showPreview && /* @__PURE__ */ jsx12(PreviewDropdown, { question })
|
|
1081
|
-
] });
|
|
1082
|
-
};
|
|
1083
|
-
var DropdownStandard_default = CustomDropdownStandard;
|
|
1084
|
-
var PreviewDropdown = ({ question }) => {
|
|
1085
|
-
var _a, _b;
|
|
1086
|
-
const previewId = `preview-${question.id}`;
|
|
1087
|
-
return /* @__PURE__ */ jsxs10(Fragment12, { children: [
|
|
1088
|
-
/* @__PURE__ */ jsx12("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1089
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx12("dd", { className: "pts-dropdown-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx12(
|
|
1090
|
-
"dd",
|
|
1091
|
-
{
|
|
1092
|
-
className: "pts-dropdown-preview pts-root-answer no-answer-preview-page",
|
|
1093
|
-
id: `answer-${previewId}`,
|
|
1094
|
-
children: "Inget svar"
|
|
1095
|
-
}
|
|
1096
|
-
)
|
|
1097
|
-
] });
|
|
1098
|
-
};
|
|
1099
|
-
|
|
1100
|
-
// src/components/input-components/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
1101
|
-
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1102
|
-
import { Fragment as Fragment13, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1103
|
-
var MultipleCheckboxes = ({
|
|
1104
|
-
question,
|
|
1105
|
-
handleQuestionInputChange,
|
|
1106
|
-
showPreview = false,
|
|
1107
|
-
activatedLanguage = "sv"
|
|
1108
|
-
}) => {
|
|
1109
|
-
var _a;
|
|
1110
|
-
const questionId = `question-${question.id}`;
|
|
1111
|
-
const [checkedValues, setCheckedValues] = useState6([]);
|
|
1112
|
-
useEffect6(() => {
|
|
1113
|
-
var _a2;
|
|
1114
|
-
const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
|
|
1115
|
-
var _a3;
|
|
1116
|
-
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
|
|
1117
|
-
}).map((option) => option.label)) || [];
|
|
1118
|
-
console.log("Initial values:", initialValues);
|
|
1119
|
-
setCheckedValues(initialValues);
|
|
1120
|
-
}, [question.answer, question.options]);
|
|
1121
|
-
const handleInputChange = (event, optionValue) => {
|
|
1122
|
-
let updatedValues = [...checkedValues];
|
|
1123
|
-
if (updatedValues.includes(optionValue)) {
|
|
1124
|
-
updatedValues = updatedValues.filter((val) => val !== optionValue);
|
|
1125
|
-
} else {
|
|
1126
|
-
updatedValues.push(optionValue);
|
|
1127
|
-
}
|
|
1128
|
-
setCheckedValues(updatedValues);
|
|
1129
|
-
const e = { target: { value: updatedValues.toString() } };
|
|
1130
|
-
handleQuestionInputChange(e, question);
|
|
1131
|
-
};
|
|
1132
|
-
return /* @__PURE__ */ jsxs11(Fragment13, { children: [
|
|
1133
|
-
!showPreview && question.visible && /* @__PURE__ */ jsx13("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs11("fieldset", { children: [
|
|
1134
|
-
/* @__PURE__ */ jsxs11("legend", { className: "multipleCheckboxes-legend", id: `label-${questionId}`, children: [
|
|
1135
|
-
question.questionLabel,
|
|
1136
|
-
" ",
|
|
1137
|
-
question.isQuestionMandatory && /* @__PURE__ */ jsx13("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
1138
|
-
" "
|
|
1139
|
-
] }),
|
|
1140
|
-
/* @__PURE__ */ jsx13("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs11(Fragment13, { children: [
|
|
1141
|
-
" ",
|
|
1142
|
-
/* @__PURE__ */ jsx13(
|
|
1143
|
-
"input",
|
|
1144
|
-
{
|
|
1145
|
-
type: "checkbox",
|
|
1146
|
-
name: `${question.id}-option`,
|
|
1147
|
-
id: `${question.id}-option-${index}`,
|
|
1148
|
-
value: option.label,
|
|
1149
|
-
checked: checkedValues.includes(option.label),
|
|
1150
|
-
onChange: (e) => handleInputChange(e, option.label),
|
|
1151
|
-
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
1152
|
-
}
|
|
1153
|
-
),
|
|
1154
|
-
/* @__PURE__ */ jsx13("label", { htmlFor: `${question.id}-option-${index}`, children: option.label })
|
|
1155
|
-
] }) }, index)) })
|
|
1156
|
-
] }) }),
|
|
1157
|
-
" ",
|
|
1158
|
-
showPreview && /* @__PURE__ */ jsx13(PrevieMultipleCheckboxes, { activatedLanguage, question })
|
|
1159
|
-
] });
|
|
1160
|
-
};
|
|
1161
|
-
var MultipleCheckboxesStandard_default = MultipleCheckboxes;
|
|
1162
|
-
var PrevieMultipleCheckboxes = ({
|
|
1163
|
-
question,
|
|
1164
|
-
activatedLanguage
|
|
1165
|
-
}) => {
|
|
1166
|
-
var _a, _b;
|
|
1167
|
-
const previewId = `preview-${question.id}`;
|
|
1168
|
-
return /* @__PURE__ */ jsxs11(Fragment13, { children: [
|
|
1169
|
-
/* @__PURE__ */ jsx13("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1170
|
-
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx13("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx13("dd", { children: /* @__PURE__ */ jsx13("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
1171
|
-
var _a2;
|
|
1172
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
1173
|
-
}).map((option, index) => /* @__PURE__ */ jsx13("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ jsx13("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
1174
|
-
" "
|
|
1175
|
-
] });
|
|
1176
|
-
};
|
|
1177
|
-
|
|
1178
1163
|
// src/helpers/hasQuestionValidationError/hasQuestionValidationError.tsx
|
|
1179
1164
|
import { isValid, parseISO } from "date-fns";
|
|
1180
1165
|
var hasQuestionValidationError = (question, questions) => {
|
|
@@ -1884,14 +1869,14 @@ var useCookieConsent = ({
|
|
|
1884
1869
|
};
|
|
1885
1870
|
|
|
1886
1871
|
// src/components/question-rendering/QuestionRenderer/QuestionRenderer.tsx
|
|
1887
|
-
import { Fragment as
|
|
1872
|
+
import { Fragment as Fragment13, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1888
1873
|
var QuestionRenderer = ({
|
|
1889
1874
|
question,
|
|
1890
1875
|
handleQuestionInputChange,
|
|
1891
1876
|
activatedLanguage = "sv",
|
|
1892
1877
|
showPreview = false
|
|
1893
1878
|
}) => {
|
|
1894
|
-
return /* @__PURE__ */ jsxs12(
|
|
1879
|
+
return /* @__PURE__ */ jsxs12(Fragment13, { children: [
|
|
1895
1880
|
question.questionType === "Radio" && /* @__PURE__ */ jsx14(
|
|
1896
1881
|
RadioMultipleStandard_default,
|
|
1897
1882
|
{
|
|
@@ -1953,22 +1938,14 @@ var QuestionRenderer = ({
|
|
|
1953
1938
|
handleQuestionInputChange,
|
|
1954
1939
|
showPreview
|
|
1955
1940
|
}
|
|
1956
|
-
),
|
|
1957
|
-
question.questionType === "Dropdown" && /* @__PURE__ */ jsx14(
|
|
1958
|
-
DropdownStandard_default,
|
|
1959
|
-
{
|
|
1960
|
-
question,
|
|
1961
|
-
handleQuestionInputChange,
|
|
1962
|
-
showPreview
|
|
1963
|
-
}
|
|
1964
1941
|
)
|
|
1965
1942
|
] });
|
|
1966
1943
|
};
|
|
1967
1944
|
var QuestionRenderer_default = QuestionRenderer;
|
|
1968
1945
|
|
|
1969
1946
|
// src/components/question-rendering/QuestionGroup/QuestionGroup.tsx
|
|
1970
|
-
import { useEffect as useEffect11, Fragment as
|
|
1971
|
-
import { Fragment as
|
|
1947
|
+
import { useEffect as useEffect11, Fragment as Fragment14 } from "react";
|
|
1948
|
+
import { Fragment as Fragment15, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1972
1949
|
var QuestionGroup = ({
|
|
1973
1950
|
questions,
|
|
1974
1951
|
wrapperElement = "none",
|
|
@@ -1978,11 +1955,12 @@ var QuestionGroup = ({
|
|
|
1978
1955
|
showPreview = false,
|
|
1979
1956
|
markQuestionAsDisplayed
|
|
1980
1957
|
}) => {
|
|
1981
|
-
var _a;
|
|
1958
|
+
var _a, _b, _c;
|
|
1982
1959
|
if (!questions || questions.length === 0) {
|
|
1983
1960
|
return null;
|
|
1984
1961
|
}
|
|
1985
1962
|
const firstQuestion = questions[0];
|
|
1963
|
+
const errorId = firstQuestion.id + "-error";
|
|
1986
1964
|
const groupMandatory = (_a = firstQuestion.validationType) == null ? void 0 : _a.find((e) => e.startsWith("groupCheck-"));
|
|
1987
1965
|
useEffect11(() => {
|
|
1988
1966
|
questions.forEach((question) => {
|
|
@@ -1991,8 +1969,8 @@ var QuestionGroup = ({
|
|
|
1991
1969
|
}
|
|
1992
1970
|
});
|
|
1993
1971
|
}, [questions]);
|
|
1994
|
-
const groupQuestions = /* @__PURE__ */ jsx15(
|
|
1995
|
-
return /* @__PURE__ */ jsx15(
|
|
1972
|
+
const groupQuestions = /* @__PURE__ */ jsx15(Fragment15, { children: questions.map((question, index) => {
|
|
1973
|
+
return /* @__PURE__ */ jsx15(Fragment14, { children: /* @__PURE__ */ jsx15(
|
|
1996
1974
|
QuestionRenderer_default,
|
|
1997
1975
|
{
|
|
1998
1976
|
question,
|
|
@@ -2014,7 +1992,7 @@ var QuestionGroup = ({
|
|
|
2014
1992
|
"aria-describedby": firstQuestion.hasValidationError ? `${firstQuestion.id}-error` : void 0,
|
|
2015
1993
|
children: [
|
|
2016
1994
|
legendLabel && /* @__PURE__ */ jsxs13("legend", { children: [
|
|
2017
|
-
/* @__PURE__ */ jsxs13("span", {
|
|
1995
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
2018
1996
|
legendLabel,
|
|
2019
1997
|
groupMandatory && /* @__PURE__ */ jsx15("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
2020
1998
|
] }),
|
|
@@ -2023,10 +2001,15 @@ var QuestionGroup = ({
|
|
|
2023
2001
|
firstQuestion.validationDefaultMessesege
|
|
2024
2002
|
] })
|
|
2025
2003
|
] }),
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2004
|
+
/* @__PURE__ */ jsx15(
|
|
2005
|
+
ValidationMessage_default,
|
|
2006
|
+
{
|
|
2007
|
+
showValidationSummary: (_b = firstQuestion.hasValidationError) != null ? _b : false,
|
|
2008
|
+
validationId: errorId,
|
|
2009
|
+
validationMessesege: (_c = firstQuestion.validationDefaultMessesege) != null ? _c : "",
|
|
2010
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
2011
|
+
}
|
|
2012
|
+
),
|
|
2030
2013
|
groupQuestions
|
|
2031
2014
|
]
|
|
2032
2015
|
}
|
|
@@ -2037,7 +2020,7 @@ var QuestionGroup = ({
|
|
|
2037
2020
|
return /* @__PURE__ */ jsx15("div", { className: "pts-root-question-group-div", children: groupQuestions });
|
|
2038
2021
|
case "none":
|
|
2039
2022
|
default:
|
|
2040
|
-
return /* @__PURE__ */ jsx15(
|
|
2023
|
+
return /* @__PURE__ */ jsx15(Fragment14, { children: groupQuestions });
|
|
2041
2024
|
}
|
|
2042
2025
|
};
|
|
2043
2026
|
var QuestionGroup_default = QuestionGroup;
|
|
@@ -2123,86 +2106,89 @@ var CookieBanner_default = CookieBanner;
|
|
|
2123
2106
|
// src/components/layout/FooterStandard/FooterStandard.tsx
|
|
2124
2107
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2125
2108
|
var Footer = ({ activatedLanguage = "sv" }) => {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
"
|
|
2131
|
-
className: "pts-footer-logo",
|
|
2132
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2133
|
-
width: "278",
|
|
2134
|
-
height: "72",
|
|
2135
|
-
viewBox: "0 0 278 72",
|
|
2136
|
-
fill: "none",
|
|
2137
|
-
children: [
|
|
2138
|
-
/* @__PURE__ */ jsx17(
|
|
2139
|
-
"path",
|
|
2140
|
-
{
|
|
2141
|
-
d: "M54 43C54 47.2 51.5 51.1 47.6 52.3C45.8 52.8 44 53 41 53H24.5C21.4 53 21 53.5 21 56.5V63C21 65.4 19.5 67 17.5 67C15.5 67 14 65.4 14 63V58.5C14 56.5 14 54.8 14.2 53.9C14.8 50.5 16.8 47.9 20.1 46.7C21.4 46.2 23.6 45.9 27.9 45.9H42C43.2 45.9 44.4 45.8 44.9 45.6C46.4 45 46.9 44 46.9 42.9C46.9 41.8 46.5 40.7 44.9 40.2C44.4 40 43.2 39.9 42 39.9H19.4C18.5 39.9 17.7 39.9 17.3 39.7C15.8 39.2 14.9 37.8 14.9 36.4C14.9 35 15.8 33.6 17.3 33.1C17.8 32.9 18.3 32.9 19.3 32.9H40.9C44 32.9 46.4 33.1 47.9 33.7C51.8 35.2 53.9 38.4 53.9 42.9L54 43ZM95.7 33.3C95.2 33.1 94.4 33 93.3 33H61.6C60.8 33 60.1 33 59.7 33.2C58 33.7 57 35 57 36.5C57 38 57.8 39.2 59.4 39.7C59.9 39.9 60.7 40 61.6 40H74V63.4C74 65.8 75.6 67 77.5 67C79.4 67 81 65.8 81 63.4V40H93.3C94.5 40 95.1 40 95.5 39.8C97.1 39.3 98 38 98 36.5C98 35 97.2 33.8 95.7 33.3ZM133.5 47.4C131.8 46.5 129.6 46 124.1 46H113.5C111.8 46 110.9 45.9 110.3 45.7C108.6 45.1 108 44 108 43C108 42 108.4 40.8 110.2 40.2C110.7 40 111.6 40 112.5 40H132C132.4 40 133.5 40 133.8 40C135.6 39.7 137 38.6 137 36.6C137 34.6 135.6 33.6 133.9 33.2C133.6 33.2 132.9 33.1 132 33.1H113.5C110.2 33.1 107.8 33.5 106.2 34.2C102.9 35.8 101 39.2 101 43.1C101 47 102.8 50.5 106.4 52.1C108 52.8 110.4 53.1 113.5 53.1H127C128.7 53.1 129.6 53.3 130.2 53.5C131.6 54 132 55.4 132 56.6C132 57.8 131.6 59.3 129.9 59.8C129.3 60 128.1 60.1 126.1 60.1H106.5C105.7 60.1 104.9 60.1 104.5 60.3C102.9 60.7 102 62 102 63.6C102 65.2 103 66.2 104.3 66.7C104.8 66.9 105.9 67.1 106.7 67.1H124C127.7 67.1 130.7 66.9 132.5 66.3C136.6 65.1 138.9 61.2 138.9 56.6C138.9 52 136.8 49.2 133.4 47.5L133.5 47.4Z",
|
|
2142
|
-
fill: "white"
|
|
2143
|
-
}
|
|
2144
|
-
),
|
|
2145
|
-
/* @__PURE__ */ jsx17(
|
|
2146
|
-
"path",
|
|
2147
|
-
{
|
|
2148
|
-
d: "M92.1 15.7L92.5 15C90 11.6 84.1 9.2 78.1 9H76.9C70.9 9.2 65 11.6 62.5 15L62.9 15.7C61.8 15.7 61 16.4 61 17.3L63.3 27C63.5 27.6 63.7 27.9 64.5 27.9H90.5C91.2 27.9 91.5 27.5 91.6 27L93.9 17.3C93.9 16.4 93.1 15.7 92 15.7H92.1ZM69.3 18.8C69.1 18.8 68.8 18.7 68.6 18.7C67.6 18.7 66.9 19.4 66.9 20.3C66.9 21.2 67.6 21.8 68.5 21.8C69.4 21.8 69.3 21.7 69.5 21.4C69.5 22.2 68.6 24 67.4 24H64.9C63.2 24 63 21.7 63 21.5C63.2 21.7 63.7 21.8 64.1 21.8C64.9 21.8 65.6 21.2 65.6 20.3C65.6 19.4 64.9 18.7 63.9 18.7C62.9 18.7 63.5 18.7 63.4 18.7C63.8 18.4 64.2 17.9 64.2 17.3C64.2 16.7 63.9 16.4 63.5 16.1L65.8 15C67.3 12.5 70 10.7 73.3 10C71.5 11.3 70 12.9 68.8 15L69.6 15.7C68.8 15.8 68.2 16.5 68.2 17.3C68.2 18.1 68.6 18.5 69.2 18.8H69.3ZM76.8 18.9C76.6 18.8 76.2 18.7 76 18.7C75 18.7 74.3 19.4 74.3 20.3C74.3 21.2 75 21.8 75.9 21.8C76.8 21.8 76.7 21.7 77 21.5C77 22.3 76.4 24 75 24H72.5C70.9 24 70.5 22 70.5 21.4C70.7 21.6 71.1 21.8 71.6 21.8C72.4 21.8 73.2 21.2 73.2 20.3C73.2 19.4 72.5 18.7 71.5 18.7C70.5 18.7 70.9 18.7 70.8 18.8C71.4 18.5 71.8 18 71.8 17.3C71.8 16.6 71.4 16.1 70.8 15.9L72.6 15C73.1 13.2 74.7 10.6 76.4 9.7C76.2 10.6 76.1 12.5 76.1 15C76.1 15 76.6 15.5 77.1 15.8C76.4 16 75.9 16.6 75.9 17.3C75.9 18 76.3 18.5 76.9 18.8L76.8 18.9ZM82.5 24H80C78.6 24 78 22.3 78 21.5C78.2 21.7 78.6 21.8 79.1 21.8C80 21.8 80.7 21.2 80.7 20.3C80.7 19.4 80 18.7 79 18.7C78 18.7 78.4 18.7 78.2 18.9C78.8 18.7 79.3 18.1 79.3 17.4C79.3 16.7 78.8 16.1 78.1 15.9C78.6 15.6 79.1 15.1 79.1 15.1C79.1 12.6 79 10.7 78.7 9.8C80.5 10.7 82.1 13.2 82.6 15.1L84.4 16C83.9 16.2 83.4 16.8 83.4 17.4C83.4 18 83.8 18.6 84.4 18.9C84.2 18.9 83.9 18.8 83.7 18.8C82.7 18.8 82 19.5 82 20.4C82 21.3 82.7 21.9 83.6 21.9C84.5 21.9 84.4 21.8 84.7 21.5C84.7 22 84.3 24.1 82.7 24.1L82.5 24ZM90 24H87.5C86.2 24 85.4 22.3 85.4 21.4C85.6 21.7 86 21.8 86.5 21.8C87.3 21.8 88 21.2 88 20.3C88 19.4 87.3 18.7 86.3 18.7C85.3 18.7 85.7 18.7 85.6 18.8C86.2 18.5 86.6 18 86.6 17.3C86.6 16.6 86 15.8 85.1 15.7L86 15C84.8 12.9 83.3 11.4 81.5 10C84.7 10.7 87.5 12.4 89 15L91.4 16.1C91 16.4 90.7 16.8 90.7 17.4C90.7 18 91.1 18.6 91.6 18.9C91.5 18.9 91.2 18.8 91 18.8C90 18.8 89.3 19.5 89.3 20.4C89.3 21.3 90 21.9 90.8 21.9C91.6 21.9 91.7 21.8 91.9 21.6C91.9 21.8 91.6 24.1 90 24.1V24ZM77.5 9C76.1 9 75 7.9 75 6.5C75 5.1 75.9 4.3 77 4.1V3H76V2H77V1H78V2H79V3H78V4.1C79.1 4.3 80 5.3 80 6.6C80 7.9 78.9 9.1 77.5 9.1V9Z",
|
|
2149
|
-
fill: "white"
|
|
2150
|
-
}
|
|
2151
|
-
)
|
|
2152
|
-
]
|
|
2153
|
-
}
|
|
2154
|
-
),
|
|
2155
|
-
/* @__PURE__ */ jsx17("nav", { className: "pts-footer-linkList", children: /* @__PURE__ */ jsxs15("ul", { children: [
|
|
2156
|
-
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2157
|
-
"a",
|
|
2158
|
-
{
|
|
2159
|
-
href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
|
|
2160
|
-
target: "_blank",
|
|
2161
|
-
rel: "noopener noreferrer",
|
|
2162
|
-
children: [
|
|
2163
|
-
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
|
|
2164
|
-
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
|
|
2165
|
-
]
|
|
2166
|
-
}
|
|
2167
|
-
) }),
|
|
2168
|
-
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2169
|
-
"a",
|
|
2170
|
-
{
|
|
2171
|
-
href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
|
|
2172
|
-
target: "_blank",
|
|
2173
|
-
rel: "noopener noreferrer",
|
|
2174
|
-
children: [
|
|
2175
|
-
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
|
|
2176
|
-
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
|
|
2177
|
-
]
|
|
2178
|
-
}
|
|
2179
|
-
) }),
|
|
2180
|
-
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2181
|
-
"a",
|
|
2182
|
-
{
|
|
2183
|
-
href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
|
|
2184
|
-
target: "_blank",
|
|
2185
|
-
rel: "noopener noreferrer",
|
|
2186
|
-
children: [
|
|
2187
|
-
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
|
|
2188
|
-
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
|
|
2189
|
-
]
|
|
2190
|
-
}
|
|
2191
|
-
) }),
|
|
2192
|
-
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2193
|
-
"a",
|
|
2109
|
+
return /* @__PURE__ */ jsxs15("footer", { className: "pts-footer-container", children: [
|
|
2110
|
+
/* @__PURE__ */ jsx17("div", { className: "pts-footer-slogan-text-container", children: /* @__PURE__ */ jsx17("p", { className: "pts-footer-slogan-text", children: activatedLanguage === "sv" ? "S\xE4ker och tillg\xE4nglig kommunikation f\xF6r Sverige" : "Secure and accessible communication for Sweden" }) }),
|
|
2111
|
+
/* @__PURE__ */ jsxs15("div", { className: "pts-footer-content", children: [
|
|
2112
|
+
/* @__PURE__ */ jsxs15(
|
|
2113
|
+
"svg",
|
|
2194
2114
|
{
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2115
|
+
"aria-label": activatedLanguage === "en" ? "PTS logotype" : "PTS logotyp",
|
|
2116
|
+
className: "pts-footer-logo",
|
|
2117
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2118
|
+
width: "278",
|
|
2119
|
+
height: "72",
|
|
2120
|
+
viewBox: "0 0 278 72",
|
|
2121
|
+
fill: "none",
|
|
2198
2122
|
children: [
|
|
2199
|
-
/* @__PURE__ */ jsx17(
|
|
2200
|
-
|
|
2123
|
+
/* @__PURE__ */ jsx17(
|
|
2124
|
+
"path",
|
|
2125
|
+
{
|
|
2126
|
+
d: "M54 43C54 47.2 51.5 51.1 47.6 52.3C45.8 52.8 44 53 41 53H24.5C21.4 53 21 53.5 21 56.5V63C21 65.4 19.5 67 17.5 67C15.5 67 14 65.4 14 63V58.5C14 56.5 14 54.8 14.2 53.9C14.8 50.5 16.8 47.9 20.1 46.7C21.4 46.2 23.6 45.9 27.9 45.9H42C43.2 45.9 44.4 45.8 44.9 45.6C46.4 45 46.9 44 46.9 42.9C46.9 41.8 46.5 40.7 44.9 40.2C44.4 40 43.2 39.9 42 39.9H19.4C18.5 39.9 17.7 39.9 17.3 39.7C15.8 39.2 14.9 37.8 14.9 36.4C14.9 35 15.8 33.6 17.3 33.1C17.8 32.9 18.3 32.9 19.3 32.9H40.9C44 32.9 46.4 33.1 47.9 33.7C51.8 35.2 53.9 38.4 53.9 42.9L54 43ZM95.7 33.3C95.2 33.1 94.4 33 93.3 33H61.6C60.8 33 60.1 33 59.7 33.2C58 33.7 57 35 57 36.5C57 38 57.8 39.2 59.4 39.7C59.9 39.9 60.7 40 61.6 40H74V63.4C74 65.8 75.6 67 77.5 67C79.4 67 81 65.8 81 63.4V40H93.3C94.5 40 95.1 40 95.5 39.8C97.1 39.3 98 38 98 36.5C98 35 97.2 33.8 95.7 33.3ZM133.5 47.4C131.8 46.5 129.6 46 124.1 46H113.5C111.8 46 110.9 45.9 110.3 45.7C108.6 45.1 108 44 108 43C108 42 108.4 40.8 110.2 40.2C110.7 40 111.6 40 112.5 40H132C132.4 40 133.5 40 133.8 40C135.6 39.7 137 38.6 137 36.6C137 34.6 135.6 33.6 133.9 33.2C133.6 33.2 132.9 33.1 132 33.1H113.5C110.2 33.1 107.8 33.5 106.2 34.2C102.9 35.8 101 39.2 101 43.1C101 47 102.8 50.5 106.4 52.1C108 52.8 110.4 53.1 113.5 53.1H127C128.7 53.1 129.6 53.3 130.2 53.5C131.6 54 132 55.4 132 56.6C132 57.8 131.6 59.3 129.9 59.8C129.3 60 128.1 60.1 126.1 60.1H106.5C105.7 60.1 104.9 60.1 104.5 60.3C102.9 60.7 102 62 102 63.6C102 65.2 103 66.2 104.3 66.7C104.8 66.9 105.9 67.1 106.7 67.1H124C127.7 67.1 130.7 66.9 132.5 66.3C136.6 65.1 138.9 61.2 138.9 56.6C138.9 52 136.8 49.2 133.4 47.5L133.5 47.4Z",
|
|
2127
|
+
fill: "white"
|
|
2128
|
+
}
|
|
2129
|
+
),
|
|
2130
|
+
/* @__PURE__ */ jsx17(
|
|
2131
|
+
"path",
|
|
2132
|
+
{
|
|
2133
|
+
d: "M92.1 15.7L92.5 15C90 11.6 84.1 9.2 78.1 9H76.9C70.9 9.2 65 11.6 62.5 15L62.9 15.7C61.8 15.7 61 16.4 61 17.3L63.3 27C63.5 27.6 63.7 27.9 64.5 27.9H90.5C91.2 27.9 91.5 27.5 91.6 27L93.9 17.3C93.9 16.4 93.1 15.7 92 15.7H92.1ZM69.3 18.8C69.1 18.8 68.8 18.7 68.6 18.7C67.6 18.7 66.9 19.4 66.9 20.3C66.9 21.2 67.6 21.8 68.5 21.8C69.4 21.8 69.3 21.7 69.5 21.4C69.5 22.2 68.6 24 67.4 24H64.9C63.2 24 63 21.7 63 21.5C63.2 21.7 63.7 21.8 64.1 21.8C64.9 21.8 65.6 21.2 65.6 20.3C65.6 19.4 64.9 18.7 63.9 18.7C62.9 18.7 63.5 18.7 63.4 18.7C63.8 18.4 64.2 17.9 64.2 17.3C64.2 16.7 63.9 16.4 63.5 16.1L65.8 15C67.3 12.5 70 10.7 73.3 10C71.5 11.3 70 12.9 68.8 15L69.6 15.7C68.8 15.8 68.2 16.5 68.2 17.3C68.2 18.1 68.6 18.5 69.2 18.8H69.3ZM76.8 18.9C76.6 18.8 76.2 18.7 76 18.7C75 18.7 74.3 19.4 74.3 20.3C74.3 21.2 75 21.8 75.9 21.8C76.8 21.8 76.7 21.7 77 21.5C77 22.3 76.4 24 75 24H72.5C70.9 24 70.5 22 70.5 21.4C70.7 21.6 71.1 21.8 71.6 21.8C72.4 21.8 73.2 21.2 73.2 20.3C73.2 19.4 72.5 18.7 71.5 18.7C70.5 18.7 70.9 18.7 70.8 18.8C71.4 18.5 71.8 18 71.8 17.3C71.8 16.6 71.4 16.1 70.8 15.9L72.6 15C73.1 13.2 74.7 10.6 76.4 9.7C76.2 10.6 76.1 12.5 76.1 15C76.1 15 76.6 15.5 77.1 15.8C76.4 16 75.9 16.6 75.9 17.3C75.9 18 76.3 18.5 76.9 18.8L76.8 18.9ZM82.5 24H80C78.6 24 78 22.3 78 21.5C78.2 21.7 78.6 21.8 79.1 21.8C80 21.8 80.7 21.2 80.7 20.3C80.7 19.4 80 18.7 79 18.7C78 18.7 78.4 18.7 78.2 18.9C78.8 18.7 79.3 18.1 79.3 17.4C79.3 16.7 78.8 16.1 78.1 15.9C78.6 15.6 79.1 15.1 79.1 15.1C79.1 12.6 79 10.7 78.7 9.8C80.5 10.7 82.1 13.2 82.6 15.1L84.4 16C83.9 16.2 83.4 16.8 83.4 17.4C83.4 18 83.8 18.6 84.4 18.9C84.2 18.9 83.9 18.8 83.7 18.8C82.7 18.8 82 19.5 82 20.4C82 21.3 82.7 21.9 83.6 21.9C84.5 21.9 84.4 21.8 84.7 21.5C84.7 22 84.3 24.1 82.7 24.1L82.5 24ZM90 24H87.5C86.2 24 85.4 22.3 85.4 21.4C85.6 21.7 86 21.8 86.5 21.8C87.3 21.8 88 21.2 88 20.3C88 19.4 87.3 18.7 86.3 18.7C85.3 18.7 85.7 18.7 85.6 18.8C86.2 18.5 86.6 18 86.6 17.3C86.6 16.6 86 15.8 85.1 15.7L86 15C84.8 12.9 83.3 11.4 81.5 10C84.7 10.7 87.5 12.4 89 15L91.4 16.1C91 16.4 90.7 16.8 90.7 17.4C90.7 18 91.1 18.6 91.6 18.9C91.5 18.9 91.2 18.8 91 18.8C90 18.8 89.3 19.5 89.3 20.4C89.3 21.3 90 21.9 90.8 21.9C91.6 21.9 91.7 21.8 91.9 21.6C91.9 21.8 91.6 24.1 90 24.1V24ZM77.5 9C76.1 9 75 7.9 75 6.5C75 5.1 75.9 4.3 77 4.1V3H76V2H77V1H78V2H79V3H78V4.1C79.1 4.3 80 5.3 80 6.6C80 7.9 78.9 9.1 77.5 9.1V9Z",
|
|
2134
|
+
fill: "white"
|
|
2135
|
+
}
|
|
2136
|
+
)
|
|
2201
2137
|
]
|
|
2202
2138
|
}
|
|
2203
|
-
)
|
|
2204
|
-
|
|
2205
|
-
|
|
2139
|
+
),
|
|
2140
|
+
/* @__PURE__ */ jsx17("nav", { className: "pts-footer-linkList", children: /* @__PURE__ */ jsxs15("ul", { children: [
|
|
2141
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2142
|
+
"a",
|
|
2143
|
+
{
|
|
2144
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
|
|
2145
|
+
target: "_blank",
|
|
2146
|
+
rel: "noopener noreferrer",
|
|
2147
|
+
children: [
|
|
2148
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
|
|
2149
|
+
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
|
|
2150
|
+
]
|
|
2151
|
+
}
|
|
2152
|
+
) }),
|
|
2153
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2154
|
+
"a",
|
|
2155
|
+
{
|
|
2156
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
|
|
2157
|
+
target: "_blank",
|
|
2158
|
+
rel: "noopener noreferrer",
|
|
2159
|
+
children: [
|
|
2160
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
|
|
2161
|
+
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
|
|
2162
|
+
]
|
|
2163
|
+
}
|
|
2164
|
+
) }),
|
|
2165
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2166
|
+
"a",
|
|
2167
|
+
{
|
|
2168
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
|
|
2169
|
+
target: "_blank",
|
|
2170
|
+
rel: "noopener noreferrer",
|
|
2171
|
+
children: [
|
|
2172
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
|
|
2173
|
+
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
) }),
|
|
2177
|
+
/* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsxs15(
|
|
2178
|
+
"a",
|
|
2179
|
+
{
|
|
2180
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
|
|
2181
|
+
target: "_blank",
|
|
2182
|
+
rel: "noopener noreferrer",
|
|
2183
|
+
children: [
|
|
2184
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens in new tab)" : "PTS Kakor (\xF6ppnas i ny flik)" }),
|
|
2185
|
+
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
|
|
2186
|
+
]
|
|
2187
|
+
}
|
|
2188
|
+
) })
|
|
2189
|
+
] }) })
|
|
2190
|
+
] })
|
|
2191
|
+
] });
|
|
2206
2192
|
};
|
|
2207
2193
|
var FooterStandard_default = Footer;
|
|
2208
2194
|
|
|
@@ -2603,7 +2589,7 @@ var Header = ({
|
|
|
2603
2589
|
if (activatedLanguage === "sv") return "English";
|
|
2604
2590
|
else return "Svenska";
|
|
2605
2591
|
};
|
|
2606
|
-
return /* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ jsx19("header", { className: "pts-header-container", children: /* @__PURE__ */ jsxs17("div", { className: "pts-header-content", children: [
|
|
2607
2593
|
/* @__PURE__ */ jsx19("div", { className: "pts-header-logo-container", children: /* @__PURE__ */ jsx19(
|
|
2608
2594
|
"a",
|
|
2609
2595
|
{
|
|
@@ -2614,7 +2600,7 @@ var Header = ({
|
|
|
2614
2600
|
children: activatedLanguage === "en" ? /* @__PURE__ */ jsx19("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx19(Logo_en, {}) }) : /* @__PURE__ */ jsx19("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx19(Logo_sv, {}) })
|
|
2615
2601
|
}
|
|
2616
2602
|
) }),
|
|
2617
|
-
useLanguage && /* @__PURE__ */ jsxs17(
|
|
2603
|
+
/* @__PURE__ */ jsx19("div", { className: "pts-header-navigation-container", children: useLanguage && /* @__PURE__ */ jsxs17(
|
|
2618
2604
|
"button",
|
|
2619
2605
|
{
|
|
2620
2606
|
lang: activatedLanguage === "en" ? "en" : "sv",
|
|
@@ -2627,8 +2613,8 @@ var Header = ({
|
|
|
2627
2613
|
activatedLanguage === "sv" && /* @__PURE__ */ jsx19("span", { className: "sr-only", children: "Change language to English" })
|
|
2628
2614
|
]
|
|
2629
2615
|
}
|
|
2630
|
-
)
|
|
2631
|
-
] });
|
|
2616
|
+
) })
|
|
2617
|
+
] }) });
|
|
2632
2618
|
};
|
|
2633
2619
|
var HeaderStandard_default = Header;
|
|
2634
2620
|
|
|
@@ -2880,13 +2866,13 @@ var TextBody = ({ data }) => {
|
|
|
2880
2866
|
var TextBody_default = TextBody;
|
|
2881
2867
|
|
|
2882
2868
|
// src/components/stepper/EditPreviewLinkStandard/EditPreviewLinkStandard.tsx
|
|
2883
|
-
import { jsx as jsx25
|
|
2869
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2884
2870
|
var EditPreviewLink = ({
|
|
2885
2871
|
step,
|
|
2886
2872
|
changeStepHandler,
|
|
2887
2873
|
activatedLanguage = "sv"
|
|
2888
2874
|
}) => {
|
|
2889
|
-
return /* @__PURE__ */ jsx25("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */
|
|
2875
|
+
return /* @__PURE__ */ jsx25("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsx25(
|
|
2890
2876
|
"a",
|
|
2891
2877
|
{
|
|
2892
2878
|
href: "#",
|
|
@@ -2895,30 +2881,7 @@ var EditPreviewLink = ({
|
|
|
2895
2881
|
e.preventDefault();
|
|
2896
2882
|
changeStepHandler(step.step);
|
|
2897
2883
|
},
|
|
2898
|
-
children:
|
|
2899
|
-
/* @__PURE__ */ jsx25(
|
|
2900
|
-
"svg",
|
|
2901
|
-
{
|
|
2902
|
-
"aria-hidden": "true",
|
|
2903
|
-
focusable: "false",
|
|
2904
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2905
|
-
width: "16",
|
|
2906
|
-
height: "16",
|
|
2907
|
-
viewBox: "0 0 16 16",
|
|
2908
|
-
fill: "none",
|
|
2909
|
-
children: /* @__PURE__ */ jsx25(
|
|
2910
|
-
"path",
|
|
2911
|
-
{
|
|
2912
|
-
d: "M10.0001 3.99996L12.0001 5.99996M8.66675 13.3333H14.0001M3.33341 10.6666L2.66675 13.3333L5.33341 12.6666L13.0574 4.94263C13.3074 4.69259 13.4478 4.35351 13.4478 3.99996C13.4478 3.64641 13.3074 3.30733 13.0574 3.05729L12.9427 2.94263C12.6927 2.69267 12.3536 2.55225 12.0001 2.55225C11.6465 2.55225 11.3075 2.69267 11.0574 2.94263L3.33341 10.6666Z",
|
|
2913
|
-
stroke: "#6E3282",
|
|
2914
|
-
strokeLinecap: "round",
|
|
2915
|
-
strokeLinejoin: "round"
|
|
2916
|
-
}
|
|
2917
|
-
)
|
|
2918
|
-
}
|
|
2919
|
-
),
|
|
2920
|
-
/* @__PURE__ */ jsx25("span", { className: "pts-edit-step-text", children: activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}` })
|
|
2921
|
-
]
|
|
2884
|
+
children: /* @__PURE__ */ jsx25("span", { className: "pts-edit-step-text", children: activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}` })
|
|
2922
2885
|
}
|
|
2923
2886
|
) });
|
|
2924
2887
|
};
|
|
@@ -2944,7 +2907,7 @@ var StartApplicationButton = ({
|
|
|
2944
2907
|
var StartApplicationButton_default = StartApplicationButton;
|
|
2945
2908
|
|
|
2946
2909
|
// src/components/stepper/StepperButtonsStandard/StepperButtonsStandard.tsx
|
|
2947
|
-
import { jsx as jsx27, jsxs as
|
|
2910
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2948
2911
|
var StepperButtons = ({
|
|
2949
2912
|
globalLanguageState,
|
|
2950
2913
|
changeStepHandler,
|
|
@@ -2954,7 +2917,7 @@ var StepperButtons = ({
|
|
|
2954
2917
|
activeStep
|
|
2955
2918
|
}) => {
|
|
2956
2919
|
const totalSteps = steps ? steps.length : "";
|
|
2957
|
-
return /* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ jsxs21("div", { className: "pts-stepperButtons-container", children: [
|
|
2958
2921
|
activeStep !== 0 && /* @__PURE__ */ jsx27(
|
|
2959
2922
|
"button",
|
|
2960
2923
|
{
|
|
@@ -2964,7 +2927,7 @@ var StepperButtons = ({
|
|
|
2964
2927
|
children: globalLanguageState ? globalLanguageState.backButton : "<<"
|
|
2965
2928
|
}
|
|
2966
2929
|
),
|
|
2967
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsxs21(
|
|
2968
2931
|
"button",
|
|
2969
2932
|
{
|
|
2970
2933
|
type: activeStep === totalSteps ? "submit" : "button",
|
|
@@ -2982,14 +2945,14 @@ var StepperButtonsStandard_default = StepperButtons;
|
|
|
2982
2945
|
|
|
2983
2946
|
// src/components/stepper/StepperStandard/StepperStandard.tsx
|
|
2984
2947
|
import React9 from "react";
|
|
2985
|
-
import { jsx as jsx28, jsxs as
|
|
2948
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2986
2949
|
var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
2987
2950
|
return /* @__PURE__ */ jsx28("div", { className: "pts-stepper-container", "aria-hidden": "true", children: arraySteps.map((step, index) => {
|
|
2988
2951
|
const isActive = step.step === activeStep;
|
|
2989
2952
|
const lastElement = arraySteps.length;
|
|
2990
2953
|
const isDone = step.step < activeStep;
|
|
2991
|
-
return /* @__PURE__ */
|
|
2992
|
-
/* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ jsxs22(React9.Fragment, { children: [
|
|
2955
|
+
/* @__PURE__ */ jsxs22("div", { className: "pts-stepper-step", children: [
|
|
2993
2956
|
/* @__PURE__ */ jsx28(
|
|
2994
2957
|
"div",
|
|
2995
2958
|
{
|
|
@@ -3024,7 +2987,7 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
|
3024
2987
|
var StepperStandard_default = Stepper;
|
|
3025
2988
|
|
|
3026
2989
|
// src/components/validation-and-status/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
|
|
3027
|
-
import { Fragment as
|
|
2990
|
+
import { Fragment as Fragment16, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3028
2991
|
var ValidationErrorSummaryList = ({
|
|
3029
2992
|
validationErrorsList,
|
|
3030
2993
|
questions,
|
|
@@ -3054,14 +3017,14 @@ var ValidationErrorSummaryList = ({
|
|
|
3054
3017
|
if (container) {
|
|
3055
3018
|
container.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
3056
3019
|
setTimeout(() => {
|
|
3057
|
-
const input = container.querySelector("input, textarea, select");
|
|
3020
|
+
const input = container.querySelector("input, textarea, select, button");
|
|
3058
3021
|
if (input) {
|
|
3059
3022
|
input.focus();
|
|
3060
3023
|
}
|
|
3061
3024
|
}, 300);
|
|
3062
3025
|
}
|
|
3063
3026
|
}
|
|
3064
|
-
if (!validationErrorsList.length) return /* @__PURE__ */ jsx29(
|
|
3027
|
+
if (!validationErrorsList.length) return /* @__PURE__ */ jsx29(Fragment16, {});
|
|
3065
3028
|
const filteredIds = filterIdsByGroupCheck(validationErrorsList, questions);
|
|
3066
3029
|
const count = filteredIds.length;
|
|
3067
3030
|
const title = summaryText.replace("{count}", count.toString()).replace(
|
|
@@ -3073,9 +3036,9 @@ var ValidationErrorSummaryList = ({
|
|
|
3073
3036
|
const found = questions.find((item) => item.id === id);
|
|
3074
3037
|
return (_a = found == null ? void 0 : found.validationSummaryLabel) != null ? _a : found == null ? void 0 : found.questionLabel;
|
|
3075
3038
|
}
|
|
3076
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ jsxs23("div", { className: `pts-errorSummary-container pts-root-error ${validationErrorsList.length === 0 ? "cleanPadding" : ""}`, children: [
|
|
3077
3040
|
/* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
3078
|
-
/* @__PURE__ */
|
|
3041
|
+
/* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
|
|
3079
3042
|
/* @__PURE__ */ jsx29("h2", { id: "errorSummary-headline", children: title }),
|
|
3080
3043
|
/* @__PURE__ */ jsx29("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx29("li", { children: /* @__PURE__ */ jsx29(
|
|
3081
3044
|
"a",
|
|
@@ -3095,10 +3058,10 @@ var ValidationErrorSummaryList = ({
|
|
|
3095
3058
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
3096
3059
|
|
|
3097
3060
|
// src/components/validation-and-status/FormStatusMessagesScreenReader/FormStatusMessagesScreenReader.tsx
|
|
3098
|
-
import { Fragment as
|
|
3061
|
+
import { Fragment as Fragment17, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3099
3062
|
var FormStatusMessagesScreenReader = ({ formStatus }) => {
|
|
3100
|
-
return /* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */ jsx30("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ jsx30("span", { className: "mandatoryAsterisk", children: "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3063
|
+
return /* @__PURE__ */ jsxs24(Fragment17, { children: [
|
|
3064
|
+
/* @__PURE__ */ jsx30("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ jsx30("span", { className: "pts-root-mandatoryAsterisk", children: "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3102
3065
|
/* @__PURE__ */ jsx30("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
|
|
3103
3066
|
] });
|
|
3104
3067
|
};
|
|
@@ -3107,7 +3070,6 @@ export {
|
|
|
3107
3070
|
AddFilesStandard_default as AddFilesStandard,
|
|
3108
3071
|
CheckboxGroupStandard_default as CheckboxGroupStandard,
|
|
3109
3072
|
CookieBanner_default as CookieBanner,
|
|
3110
|
-
DropdownStandard_default as DropdownStandard,
|
|
3111
3073
|
EditPreviewLinkStandard_default as EditPreviewLinkStandard,
|
|
3112
3074
|
FooterStandard_default as FooterStandard,
|
|
3113
3075
|
FormStatusMessagesScreenReader_default as FormStatusMessagesScreenReader,
|