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.js
CHANGED
|
@@ -33,7 +33,6 @@ __export(index_exports, {
|
|
|
33
33
|
AddFilesStandard: () => AddFilesStandard_default,
|
|
34
34
|
CheckboxGroupStandard: () => CheckboxGroupStandard_default,
|
|
35
35
|
CookieBanner: () => CookieBanner_default,
|
|
36
|
-
DropdownStandard: () => DropdownStandard_default,
|
|
37
36
|
EditPreviewLinkStandard: () => EditPreviewLinkStandard_default,
|
|
38
37
|
FooterStandard: () => FooterStandard_default,
|
|
39
38
|
FormStatusMessagesScreenReader: () => FormStatusMessagesScreenReader_default,
|
|
@@ -81,14 +80,32 @@ __export(index_exports, {
|
|
|
81
80
|
});
|
|
82
81
|
module.exports = __toCommonJS(index_exports);
|
|
83
82
|
|
|
84
|
-
// src/components/
|
|
83
|
+
// src/components/layout/ValidationMessage/ValidationMessage.tsx
|
|
85
84
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
85
|
+
var ValidationSummary = ({
|
|
86
|
+
validationMessesege,
|
|
87
|
+
validationId,
|
|
88
|
+
activatedLanguage = "sv",
|
|
89
|
+
showValidationSummary = false,
|
|
90
|
+
extraCssClass = ""
|
|
91
|
+
}) => {
|
|
92
|
+
return showValidationSummary && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `pts-root-error ${extraCssClass}`, id: validationId, children: [
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: activatedLanguage === "sv" ? "Valideringsfel" : "Validation error" }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "errorText", children: validationMessesege })
|
|
96
|
+
] });
|
|
97
|
+
};
|
|
98
|
+
var ValidationMessage_default = ValidationSummary;
|
|
99
|
+
|
|
100
|
+
// src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
|
|
101
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
86
102
|
var InputRadio = ({
|
|
87
103
|
question,
|
|
88
104
|
handleQuestionInputChange,
|
|
89
|
-
showPreview = false
|
|
105
|
+
showPreview = false,
|
|
106
|
+
activatedLanguage = "sv"
|
|
90
107
|
}) => {
|
|
91
|
-
var _a;
|
|
108
|
+
var _a, _b, _c;
|
|
92
109
|
const questionId = `question-${question.id}`;
|
|
93
110
|
const groupId = `radio-group-${question.id}`;
|
|
94
111
|
const errorId = `error-${question.id}`;
|
|
@@ -96,21 +113,22 @@ var InputRadio = ({
|
|
|
96
113
|
const e = { target: { value: event.target.value } };
|
|
97
114
|
handleQuestionInputChange(e, question);
|
|
98
115
|
};
|
|
99
|
-
|
|
100
|
-
|
|
116
|
+
console.log("question", question);
|
|
117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
118
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
101
119
|
"fieldset",
|
|
102
120
|
{
|
|
103
121
|
"aria-required": question.isQuestionMandatory,
|
|
104
122
|
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
105
123
|
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
106
124
|
children: [
|
|
107
|
-
/* @__PURE__ */ (0,
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("legend", { id: `label-${groupId}`, children: [
|
|
108
126
|
question.questionLabel,
|
|
109
127
|
" ",
|
|
110
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0,
|
|
128
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
111
129
|
] }),
|
|
112
|
-
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0,
|
|
113
|
-
/* @__PURE__ */ (0,
|
|
130
|
+
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pts-radio-option", children: [
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
114
132
|
"input",
|
|
115
133
|
{
|
|
116
134
|
type: "radio",
|
|
@@ -121,27 +139,31 @@ var InputRadio = ({
|
|
|
121
139
|
onChange: handleInputChange
|
|
122
140
|
}
|
|
123
141
|
),
|
|
124
|
-
/* @__PURE__ */ (0,
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: `${groupId}-option-${index}`, children: option.label }),
|
|
125
143
|
" "
|
|
126
144
|
] }, index)),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
146
|
+
ValidationMessage_default,
|
|
147
|
+
{
|
|
148
|
+
showValidationSummary: (_b = question.hasValidationError) != null ? _b : false,
|
|
149
|
+
validationId: errorId,
|
|
150
|
+
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
151
|
+
activatedLanguage
|
|
152
|
+
}
|
|
153
|
+
)
|
|
132
154
|
]
|
|
133
155
|
}
|
|
134
156
|
) }),
|
|
135
|
-
showPreview && /* @__PURE__ */ (0,
|
|
157
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PreviewRadio, { question })
|
|
136
158
|
] });
|
|
137
159
|
};
|
|
138
160
|
var RadioMultipleStandard_default = InputRadio;
|
|
139
161
|
var PreviewRadio = ({ question }) => {
|
|
140
162
|
var _a, _b;
|
|
141
163
|
const previewId = `preview-${question.id}`;
|
|
142
|
-
return /* @__PURE__ */ (0,
|
|
143
|
-
/* @__PURE__ */ (0,
|
|
144
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0,
|
|
164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
166
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
145
167
|
"dd",
|
|
146
168
|
{
|
|
147
169
|
className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
|
|
@@ -152,10 +174,10 @@ var PreviewRadio = ({ question }) => {
|
|
|
152
174
|
] });
|
|
153
175
|
};
|
|
154
176
|
|
|
155
|
-
// src/components/input-components/
|
|
177
|
+
// src/components/input-components/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
156
178
|
var import_react = require("react");
|
|
157
|
-
var
|
|
158
|
-
var
|
|
179
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
180
|
+
var MultipleCheckboxes = ({
|
|
159
181
|
question,
|
|
160
182
|
handleQuestionInputChange,
|
|
161
183
|
showPreview = false,
|
|
@@ -163,8 +185,6 @@ var CheckboxGroup = ({
|
|
|
163
185
|
}) => {
|
|
164
186
|
var _a;
|
|
165
187
|
const questionId = `question-${question.id}`;
|
|
166
|
-
const errorId = `error-${question.id}`;
|
|
167
|
-
const groupId = `checkbox-group-${question.id}`;
|
|
168
188
|
const [checkedValues, setCheckedValues] = (0, import_react.useState)([]);
|
|
169
189
|
(0, import_react.useEffect)(() => {
|
|
170
190
|
var _a2;
|
|
@@ -172,6 +192,7 @@ var CheckboxGroup = ({
|
|
|
172
192
|
var _a3;
|
|
173
193
|
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
|
|
174
194
|
}).map((option) => option.label)) || [];
|
|
195
|
+
console.log("Initial values:", initialValues);
|
|
175
196
|
setCheckedValues(initialValues);
|
|
176
197
|
}, [question.answer, question.options]);
|
|
177
198
|
const handleInputChange = (event, optionValue) => {
|
|
@@ -185,21 +206,100 @@ var CheckboxGroup = ({
|
|
|
185
206
|
const e = { target: { value: updatedValues.toString() } };
|
|
186
207
|
handleQuestionInputChange(e, question);
|
|
187
208
|
};
|
|
188
|
-
return /* @__PURE__ */ (0,
|
|
189
|
-
!showPreview && question.visible && /* @__PURE__ */ (0,
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
210
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { children: [
|
|
211
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("legend", { className: "multipleCheckboxes-legend", id: `label-${questionId}`, children: [
|
|
212
|
+
question.questionLabel,
|
|
213
|
+
" ",
|
|
214
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
215
|
+
" "
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
218
|
+
" ",
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
220
|
+
"input",
|
|
221
|
+
{
|
|
222
|
+
type: "checkbox",
|
|
223
|
+
name: `${question.id}-option`,
|
|
224
|
+
id: `${question.id}-option-${index}`,
|
|
225
|
+
value: option.label,
|
|
226
|
+
checked: checkedValues.includes(option.label),
|
|
227
|
+
onChange: (e) => handleInputChange(e, option.label),
|
|
228
|
+
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${question.id}-option-${index}`, children: option.label })
|
|
232
|
+
] }) }, index)) })
|
|
233
|
+
] }) }),
|
|
234
|
+
" ",
|
|
235
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PrevieMultipleCheckboxes, { activatedLanguage, question })
|
|
236
|
+
] });
|
|
237
|
+
};
|
|
238
|
+
var MultipleCheckboxesStandard_default = MultipleCheckboxes;
|
|
239
|
+
var PrevieMultipleCheckboxes = ({
|
|
240
|
+
question,
|
|
241
|
+
activatedLanguage
|
|
242
|
+
}) => {
|
|
243
|
+
var _a, _b;
|
|
244
|
+
const previewId = `preview-${question.id}`;
|
|
245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
246
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
247
|
+
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { children: question.options[0].label }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
248
|
+
var _a2;
|
|
249
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
250
|
+
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
251
|
+
" "
|
|
252
|
+
] });
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// src/components/input-components/CheckboxGroupStandard/CheckboxGroupStandard.tsx
|
|
256
|
+
var import_react2 = require("react");
|
|
257
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
258
|
+
var CheckboxGroup = ({
|
|
259
|
+
question,
|
|
260
|
+
handleQuestionInputChange,
|
|
261
|
+
showPreview = false,
|
|
262
|
+
activatedLanguage = "sv"
|
|
263
|
+
}) => {
|
|
264
|
+
var _a, _b, _c;
|
|
265
|
+
const questionId = `question-${question.id}`;
|
|
266
|
+
const errorId = `error-${question.id}`;
|
|
267
|
+
const groupId = `checkbox-group-${question.id}`;
|
|
268
|
+
const [checkedValues, setCheckedValues] = (0, import_react2.useState)([]);
|
|
269
|
+
(0, import_react2.useEffect)(() => {
|
|
270
|
+
var _a2;
|
|
271
|
+
const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
|
|
272
|
+
var _a3;
|
|
273
|
+
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
|
|
274
|
+
}).map((option) => option.label)) || [];
|
|
275
|
+
setCheckedValues(initialValues);
|
|
276
|
+
}, [question.answer, question.options]);
|
|
277
|
+
const handleInputChange = (event, optionValue) => {
|
|
278
|
+
let updatedValues = [...checkedValues];
|
|
279
|
+
if (updatedValues.includes(optionValue)) {
|
|
280
|
+
updatedValues = updatedValues.filter((val) => val !== optionValue);
|
|
281
|
+
} else {
|
|
282
|
+
updatedValues.push(optionValue);
|
|
283
|
+
}
|
|
284
|
+
setCheckedValues(updatedValues);
|
|
285
|
+
const e = { target: { value: updatedValues.toString() } };
|
|
286
|
+
handleQuestionInputChange(e, question);
|
|
287
|
+
};
|
|
288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
289
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { id: questionId, className: "pts-root-question pts-checkboxGroup-container", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
190
290
|
"fieldset",
|
|
191
291
|
{
|
|
192
292
|
"aria-required": question.isQuestionMandatory,
|
|
193
293
|
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
194
294
|
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
195
295
|
children: [
|
|
196
|
-
/* @__PURE__ */ (0,
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("legend", { className: "pts-checkboxGroup-legend", id: `label-${groupId}`, children: [
|
|
197
297
|
question.questionLabel,
|
|
198
298
|
" ",
|
|
199
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0,
|
|
299
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
200
300
|
] }),
|
|
201
|
-
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0,
|
|
202
|
-
/* @__PURE__ */ (0,
|
|
301
|
+
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "pts-checkboxGroup-options", children: [
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
203
303
|
"input",
|
|
204
304
|
{
|
|
205
305
|
type: "checkbox",
|
|
@@ -211,17 +311,21 @@ var CheckboxGroup = ({
|
|
|
211
311
|
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
212
312
|
}
|
|
213
313
|
),
|
|
214
|
-
/* @__PURE__ */ (0,
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${groupId}-option-${index}`, children: option.label })
|
|
215
315
|
] }, index)),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
316
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
317
|
+
ValidationMessage_default,
|
|
318
|
+
{
|
|
319
|
+
showValidationSummary: (_b = question.hasValidationError) != null ? _b : false,
|
|
320
|
+
validationId: errorId,
|
|
321
|
+
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
322
|
+
activatedLanguage
|
|
323
|
+
}
|
|
324
|
+
)
|
|
221
325
|
]
|
|
222
326
|
}
|
|
223
327
|
) }),
|
|
224
|
-
showPreview && /* @__PURE__ */ (0,
|
|
328
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PreviewCheckboxGroup, { activatedLanguage, question })
|
|
225
329
|
] });
|
|
226
330
|
};
|
|
227
331
|
var CheckboxGroupStandard_default = CheckboxGroup;
|
|
@@ -231,44 +335,44 @@ var PreviewCheckboxGroup = ({
|
|
|
231
335
|
}) => {
|
|
232
336
|
var _a, _b;
|
|
233
337
|
const previewId = `preview-${question.id}`;
|
|
234
|
-
return /* @__PURE__ */ (0,
|
|
235
|
-
/* @__PURE__ */ (0,
|
|
236
|
-
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ (0,
|
|
338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
340
|
+
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: question.options[0].label }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
237
341
|
var _a2;
|
|
238
342
|
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
239
|
-
}).map((option, index) => /* @__PURE__ */ (0,
|
|
343
|
+
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
240
344
|
" "
|
|
241
345
|
] });
|
|
242
346
|
};
|
|
243
347
|
|
|
244
348
|
// src/components/input-components/TextAreaStandard/TextAreaStandard.tsx
|
|
245
349
|
var import_dompurify = __toESM(require("dompurify"));
|
|
246
|
-
var
|
|
350
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
247
351
|
var InputTextarea = ({
|
|
248
352
|
question,
|
|
249
353
|
handleQuestionInputChange,
|
|
250
354
|
showPreview = false,
|
|
251
355
|
activatedLanguage
|
|
252
356
|
}) => {
|
|
253
|
-
var _a, _b, _c, _d, _e;
|
|
357
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
254
358
|
const questionId = `question-${question.id}`;
|
|
255
359
|
const inputId = `textarea-${question.id}`;
|
|
256
360
|
const aboutId = `about-${question.id}`;
|
|
257
361
|
const errorId = `error-${question.id}`;
|
|
258
362
|
const defaultMaxLength = 1e3;
|
|
259
|
-
return /* @__PURE__ */ (0,
|
|
260
|
-
!showPreview && question.visible && /* @__PURE__ */ (0,
|
|
363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
364
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
261
365
|
"div",
|
|
262
366
|
{
|
|
263
367
|
id: questionId,
|
|
264
368
|
className: `pts-root-question pts-textArea-container${question.aboutText ? " pts-question-hasAbout" : ""}`,
|
|
265
369
|
children: [
|
|
266
|
-
/* @__PURE__ */ (0,
|
|
370
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { htmlFor: inputId, children: [
|
|
267
371
|
question.questionLabel,
|
|
268
372
|
" ",
|
|
269
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0,
|
|
373
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "pts-root-mandatoryAsterisk", "aria-hidden": "true", children: "*" })
|
|
270
374
|
] }),
|
|
271
|
-
question.aboutText && /* @__PURE__ */ (0,
|
|
375
|
+
question.aboutText && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
272
376
|
"div",
|
|
273
377
|
{
|
|
274
378
|
id: aboutId,
|
|
@@ -278,7 +382,7 @@ var InputTextarea = ({
|
|
|
278
382
|
}
|
|
279
383
|
}
|
|
280
384
|
),
|
|
281
|
-
/* @__PURE__ */ (0,
|
|
385
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
282
386
|
"textarea",
|
|
283
387
|
{
|
|
284
388
|
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0,
|
|
@@ -292,20 +396,25 @@ var InputTextarea = ({
|
|
|
292
396
|
id: inputId
|
|
293
397
|
}
|
|
294
398
|
),
|
|
295
|
-
/* @__PURE__ */ (0,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "pts-textarea-counter-error-container", children: [
|
|
400
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
401
|
+
ValidationMessage_default,
|
|
402
|
+
{
|
|
403
|
+
showValidationSummary: (_b = question.hasValidationError) != null ? _b : false,
|
|
404
|
+
validationId: errorId,
|
|
405
|
+
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
406
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
!((_d = question.questionExtraAttribute) == null ? void 0 : _d.hideTextCounter) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
301
410
|
"div",
|
|
302
411
|
{
|
|
303
|
-
className: `pts-character-counter ${question.answer && (((
|
|
412
|
+
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" : ""}`,
|
|
304
413
|
children: [
|
|
305
414
|
question.answer ? question.answer.length : 0,
|
|
306
415
|
" av",
|
|
307
416
|
" ",
|
|
308
|
-
((
|
|
417
|
+
((_g = question.questionExtraAttribute) == null ? void 0 : _g.answerMaxLength) || defaultMaxLength,
|
|
309
418
|
" tecken"
|
|
310
419
|
]
|
|
311
420
|
}
|
|
@@ -314,7 +423,7 @@ var InputTextarea = ({
|
|
|
314
423
|
]
|
|
315
424
|
}
|
|
316
425
|
),
|
|
317
|
-
showPreview && /* @__PURE__ */ (0,
|
|
426
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PreviewTextarea, { activatedLanguage, question })
|
|
318
427
|
] });
|
|
319
428
|
};
|
|
320
429
|
var TextAreaStandard_default = InputTextarea;
|
|
@@ -324,9 +433,9 @@ var PreviewTextarea = ({
|
|
|
324
433
|
}) => {
|
|
325
434
|
var _a, _b;
|
|
326
435
|
const previewId = `preview-${question.id}`;
|
|
327
|
-
return /* @__PURE__ */ (0,
|
|
328
|
-
/* @__PURE__ */ (0,
|
|
329
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0,
|
|
436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
437
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
438
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
330
439
|
"dd",
|
|
331
440
|
{
|
|
332
441
|
className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
|
|
@@ -339,32 +448,32 @@ var PreviewTextarea = ({
|
|
|
339
448
|
|
|
340
449
|
// src/components/input-components/TextFieldStandard/TextFieldStandard.tsx
|
|
341
450
|
var import_dompurify2 = __toESM(require("dompurify"));
|
|
342
|
-
var
|
|
451
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
343
452
|
var TextFieldStandard = ({
|
|
344
453
|
question,
|
|
345
454
|
handleQuestionInputChange,
|
|
346
455
|
showPreview = false,
|
|
347
456
|
activatedLanguage
|
|
348
457
|
}) => {
|
|
349
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
458
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
350
459
|
const questionId = `question-${question.id}`;
|
|
351
460
|
const inputId = `textField-${question.id}`;
|
|
352
461
|
const aboutId = `about-${question.id}`;
|
|
353
462
|
const errorId = `error-${question.id}`;
|
|
354
463
|
const defaultMaxLength = 1e3;
|
|
355
|
-
return /* @__PURE__ */ (0,
|
|
356
|
-
!showPreview && question.visible && /* @__PURE__ */ (0,
|
|
464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
465
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
357
466
|
"div",
|
|
358
467
|
{
|
|
359
468
|
id: questionId,
|
|
360
469
|
className: `pts-root-question pts-textField-container${((_a = question.questionExtraAttribute) == null ? void 0 : _a.disabled) ? " pts-textField-disabled" : ""}${question.aboutText ? " pts-question-hasAbout" : ""}`.trim(),
|
|
361
470
|
children: [
|
|
362
|
-
/* @__PURE__ */ (0,
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor: inputId, children: [
|
|
363
472
|
question.questionLabel,
|
|
364
473
|
" ",
|
|
365
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0,
|
|
474
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": "true", className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
366
475
|
] }),
|
|
367
|
-
question.aboutText && /* @__PURE__ */ (0,
|
|
476
|
+
question.aboutText && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
368
477
|
"div",
|
|
369
478
|
{
|
|
370
479
|
id: aboutId,
|
|
@@ -374,7 +483,7 @@ var TextFieldStandard = ({
|
|
|
374
483
|
}
|
|
375
484
|
}
|
|
376
485
|
),
|
|
377
|
-
/* @__PURE__ */ (0,
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
378
487
|
"input",
|
|
379
488
|
{
|
|
380
489
|
type: (_c = (_b = question.questionExtraAttribute) == null ? void 0 : _b.inputType) != null ? _c : "text",
|
|
@@ -396,15 +505,24 @@ var TextFieldStandard = ({
|
|
|
396
505
|
autoCapitalize: (_m = (_l = question.questionExtraAttribute) == null ? void 0 : _l.autoCapitalize) != null ? _m : void 0
|
|
397
506
|
}
|
|
398
507
|
),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
509
|
+
ValidationMessage_default,
|
|
510
|
+
{
|
|
511
|
+
showValidationSummary: (_n = question.hasValidationError) != null ? _n : false,
|
|
512
|
+
validationId: errorId,
|
|
513
|
+
validationMessesege: (_o = question.validationDefaultMessesege) != null ? _o : "",
|
|
514
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
515
|
+
}
|
|
516
|
+
),
|
|
517
|
+
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
520
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
403
521
|
] })
|
|
404
522
|
]
|
|
405
523
|
}
|
|
406
524
|
),
|
|
407
|
-
showPreview && /* @__PURE__ */ (0,
|
|
525
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PreviewTextField, { activatedLanguage, question })
|
|
408
526
|
] });
|
|
409
527
|
};
|
|
410
528
|
var TextFieldStandard_default = TextFieldStandard;
|
|
@@ -414,9 +532,9 @@ var PreviewTextField = ({
|
|
|
414
532
|
}) => {
|
|
415
533
|
var _a, _b;
|
|
416
534
|
const previewId = `preview-${question.id}`;
|
|
417
|
-
return /* @__PURE__ */ (0,
|
|
418
|
-
/* @__PURE__ */ (0,
|
|
419
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0,
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
537
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
420
538
|
"dd",
|
|
421
539
|
{
|
|
422
540
|
className: "pts-textField-preview pts-root-answer no-answer-preview-page",
|
|
@@ -428,12 +546,12 @@ var PreviewTextField = ({
|
|
|
428
546
|
};
|
|
429
547
|
|
|
430
548
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
431
|
-
var
|
|
549
|
+
var import_react7 = require("react");
|
|
432
550
|
var import_clsx3 = __toESM(require("clsx"));
|
|
433
551
|
|
|
434
552
|
// src/components/input-components/AddFilesStandard/DropFilesStandard.tsx
|
|
435
553
|
var import_react_dropzone = require("react-dropzone");
|
|
436
|
-
var
|
|
554
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
437
555
|
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
|
|
438
556
|
const onDrop = FilesSelected;
|
|
439
557
|
const { getRootProps, getInputProps, isDragActive } = (0, import_react_dropzone.useDropzone)({ onDrop, noKeyboard: true });
|
|
@@ -441,10 +559,10 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
441
559
|
event.preventDefault();
|
|
442
560
|
event.stopPropagation();
|
|
443
561
|
};
|
|
444
|
-
return /* @__PURE__ */ (0,
|
|
445
|
-
/* @__PURE__ */ (0,
|
|
562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "DropZoneContainer", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "DropZone", ...getRootProps(), onClick: handleFileExplorer, children: [
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { htmlFor: "fileDropInput", hidden: true, children: [
|
|
446
564
|
"Dra och sl\xE4pp filer h\xE4r omr\xE5de",
|
|
447
|
-
/* @__PURE__ */ (0,
|
|
565
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
448
566
|
"input",
|
|
449
567
|
{
|
|
450
568
|
...getInputProps({
|
|
@@ -455,8 +573,8 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
455
573
|
}
|
|
456
574
|
)
|
|
457
575
|
] }),
|
|
458
|
-
isDragActive ? /* @__PURE__ */ (0,
|
|
459
|
-
/* @__PURE__ */ (0,
|
|
576
|
+
isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { className: "dropFilesNowText", children: language === "sv" ? "Sl\xE4pp filerna, nu ...!" : "Drop files here!" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "DropZone-label-container", children: [
|
|
577
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
460
578
|
"svg",
|
|
461
579
|
{
|
|
462
580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -464,7 +582,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
464
582
|
height: "2.4rem",
|
|
465
583
|
viewBox: "0 0 7 15",
|
|
466
584
|
fill: "#fff",
|
|
467
|
-
children: /* @__PURE__ */ (0,
|
|
585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
468
586
|
"path",
|
|
469
587
|
{
|
|
470
588
|
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",
|
|
@@ -473,26 +591,26 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
473
591
|
)
|
|
474
592
|
}
|
|
475
593
|
),
|
|
476
|
-
/* @__PURE__ */ (0,
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dropFilesText", children: DropFilesText })
|
|
477
595
|
] })
|
|
478
596
|
] }) }) });
|
|
479
597
|
};
|
|
480
598
|
var DropFilesStandard_default = DropFiles;
|
|
481
599
|
|
|
482
600
|
// src/components/input-components/AddFilesStandard/ExploreFilesStandard.tsx
|
|
483
|
-
var
|
|
601
|
+
var import_react4 = require("react");
|
|
484
602
|
var import_clsx = __toESM(require("clsx"));
|
|
485
603
|
|
|
486
604
|
// src/components/input-components/AddFilesStandard/ScreenReaderErrors.tsx
|
|
487
|
-
var
|
|
488
|
-
var
|
|
605
|
+
var import_react3 = __toESM(require("react"));
|
|
606
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
489
607
|
var ScreenReaderErrors = ({
|
|
490
608
|
errorMessageAddingFile,
|
|
491
609
|
activatedLanguage
|
|
492
610
|
}) => {
|
|
493
|
-
const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] =
|
|
494
|
-
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] =
|
|
495
|
-
|
|
611
|
+
const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] = import_react3.default.useState(false);
|
|
612
|
+
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react3.default.useState("");
|
|
613
|
+
import_react3.default.useEffect(() => {
|
|
496
614
|
if (errorMessageAddingFile.length > 0) {
|
|
497
615
|
let errorMessages = "";
|
|
498
616
|
errorMessages += errorMessageAddingFile.length;
|
|
@@ -504,12 +622,12 @@ var ScreenReaderErrors = ({
|
|
|
504
622
|
setActivateErrorMessagesForScreenReader(true);
|
|
505
623
|
}
|
|
506
624
|
}, [errorMessageAddingFile]);
|
|
507
|
-
return /* @__PURE__ */ (0,
|
|
625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
|
|
508
626
|
};
|
|
509
627
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
510
628
|
|
|
511
629
|
// src/components/input-components/AddFilesStandard/ExploreFilesStandard.tsx
|
|
512
|
-
var
|
|
630
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
513
631
|
var ExploreFiles = ({
|
|
514
632
|
FilesSelected,
|
|
515
633
|
numberOfFiles,
|
|
@@ -523,8 +641,8 @@ var ExploreFiles = ({
|
|
|
523
641
|
showErrors,
|
|
524
642
|
errorMessageAddingFile
|
|
525
643
|
}) => {
|
|
526
|
-
const fileInputRef = (0,
|
|
527
|
-
const buttonInputRef = (0,
|
|
644
|
+
const fileInputRef = (0, import_react4.useRef)(null);
|
|
645
|
+
const buttonInputRef = (0, import_react4.useRef)(null);
|
|
528
646
|
const handleFiles = (event) => {
|
|
529
647
|
const files = Array.from(event.target.files || []);
|
|
530
648
|
FilesSelected(files);
|
|
@@ -536,8 +654,8 @@ var ExploreFiles = ({
|
|
|
536
654
|
};
|
|
537
655
|
let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
|
|
538
656
|
const ariaLabelText = `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`;
|
|
539
|
-
return /* @__PURE__ */ (0,
|
|
540
|
-
/* @__PURE__ */ (0,
|
|
657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "inputContainer", children: [
|
|
658
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
541
659
|
"div",
|
|
542
660
|
{
|
|
543
661
|
className: (0, import_clsx.default)(
|
|
@@ -547,7 +665,7 @@ var ExploreFiles = ({
|
|
|
547
665
|
),
|
|
548
666
|
id: labelId,
|
|
549
667
|
children: [
|
|
550
|
-
/* @__PURE__ */ (0,
|
|
668
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
551
669
|
"button",
|
|
552
670
|
{
|
|
553
671
|
ref: buttonInputRef,
|
|
@@ -562,12 +680,12 @@ var ExploreFiles = ({
|
|
|
562
680
|
children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
|
|
563
681
|
}
|
|
564
682
|
),
|
|
565
|
-
/* @__PURE__ */ (0,
|
|
566
|
-
/* @__PURE__ */ (0,
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { "aria-hidden": true, className: "filePickText", children: addFilesInfoText }),
|
|
684
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: inputId, "aria-hidden": true, className: "invisible" })
|
|
567
685
|
]
|
|
568
686
|
}
|
|
569
687
|
),
|
|
570
|
-
/* @__PURE__ */ (0,
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
571
689
|
"input",
|
|
572
690
|
{
|
|
573
691
|
"aria-hidden": true,
|
|
@@ -580,7 +698,7 @@ var ExploreFiles = ({
|
|
|
580
698
|
id: inputId
|
|
581
699
|
}
|
|
582
700
|
),
|
|
583
|
-
/* @__PURE__ */ (0,
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
584
702
|
ScreenReaderErrors_default,
|
|
585
703
|
{
|
|
586
704
|
errorMessageAddingFile,
|
|
@@ -592,22 +710,22 @@ var ExploreFiles = ({
|
|
|
592
710
|
var ExploreFilesStandard_default = ExploreFiles;
|
|
593
711
|
|
|
594
712
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
595
|
-
var
|
|
713
|
+
var import_react6 = __toESM(require("react"));
|
|
596
714
|
var import_react_bootstrap = require("react-bootstrap");
|
|
597
715
|
|
|
598
716
|
// src/components/input-components/AddFilesStandard/IndicatorStandard.tsx
|
|
599
|
-
var
|
|
717
|
+
var import_react5 = require("react");
|
|
600
718
|
var import_clsx2 = __toESM(require("clsx"));
|
|
601
|
-
var
|
|
719
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
602
720
|
var Indicator = (filename) => {
|
|
603
|
-
const [uploadPercentage, setUploadPercentage] = (0,
|
|
604
|
-
const [uploadDone, setUploadDone] = (0,
|
|
605
|
-
return /* @__PURE__ */ (0,
|
|
721
|
+
const [uploadPercentage, setUploadPercentage] = (0, import_react5.useState)(0);
|
|
722
|
+
const [uploadDone, setUploadDone] = (0, import_react5.useState)(false);
|
|
723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx2.default)("uploadIndicator", "uploadDone") }) });
|
|
606
724
|
};
|
|
607
725
|
var IndicatorStandard_default = Indicator;
|
|
608
726
|
|
|
609
727
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
610
|
-
var
|
|
728
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
611
729
|
var SelectedFiles = ({
|
|
612
730
|
questionObject,
|
|
613
731
|
isTouched,
|
|
@@ -620,7 +738,7 @@ var SelectedFiles = ({
|
|
|
620
738
|
setNumberOfFiles,
|
|
621
739
|
removeUploadErrors
|
|
622
740
|
}) => {
|
|
623
|
-
const theDiv = (0,
|
|
741
|
+
const theDiv = (0, import_react6.useRef)(null);
|
|
624
742
|
const remove = (file) => {
|
|
625
743
|
let newFiles = questionObject.files.filter((f) => f !== file);
|
|
626
744
|
const newCountOfFiles = newFiles.length;
|
|
@@ -629,13 +747,13 @@ var SelectedFiles = ({
|
|
|
629
747
|
isTouched(e, questionObject);
|
|
630
748
|
removeFile(newCountOfFiles);
|
|
631
749
|
};
|
|
632
|
-
(0,
|
|
750
|
+
(0, import_react6.useEffect)(() => {
|
|
633
751
|
var _a;
|
|
634
752
|
numberOfFiles > 0 && ((_a = theDiv.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "end" }));
|
|
635
753
|
}, [numberOfFiles]);
|
|
636
754
|
const useWindowWidth = () => {
|
|
637
|
-
const [windowWidth2, setWindowWidth] = (0,
|
|
638
|
-
(0,
|
|
755
|
+
const [windowWidth2, setWindowWidth] = (0, import_react6.useState)(window.innerWidth);
|
|
756
|
+
(0, import_react6.useEffect)(() => {
|
|
639
757
|
const handleResize = () => {
|
|
640
758
|
setWindowWidth(window.innerWidth);
|
|
641
759
|
};
|
|
@@ -647,10 +765,10 @@ var SelectedFiles = ({
|
|
|
647
765
|
return windowWidth2;
|
|
648
766
|
};
|
|
649
767
|
const windowWidth = useWindowWidth();
|
|
650
|
-
return /* @__PURE__ */ (0,
|
|
651
|
-
/* @__PURE__ */ (0,
|
|
652
|
-
/* @__PURE__ */ (0,
|
|
653
|
-
/* @__PURE__ */ (0,
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
769
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "pts-errorSummary-container pts-addFile-error-container", children: [
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
771
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("ul", { "aria-hidden": true, className: "fileListUnorderedList", id: "errorSummary-ul", children: [
|
|
654
772
|
" ",
|
|
655
773
|
errorMessageAddingFile.map((errorObj, index) => {
|
|
656
774
|
const errorFileName = errorObj.FileName;
|
|
@@ -658,9 +776,9 @@ var SelectedFiles = ({
|
|
|
658
776
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
659
777
|
const fileType = errorObj.FileName.split(".").pop();
|
|
660
778
|
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
661
|
-
return /* @__PURE__ */ (0,
|
|
662
|
-
/* @__PURE__ */ (0,
|
|
663
|
-
/* @__PURE__ */ (0,
|
|
779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "fileInListContainer", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "fileInList", children: [
|
|
780
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Col, { children: windowWidth < 768 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "desktopFileName", children: errorObj.FileName }) }) }),
|
|
781
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
664
782
|
import_react_bootstrap.Col,
|
|
665
783
|
{
|
|
666
784
|
className: "errorMessageAddingFile",
|
|
@@ -675,7 +793,7 @@ var SelectedFiles = ({
|
|
|
675
793
|
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
676
794
|
})
|
|
677
795
|
] }) }),
|
|
678
|
-
/* @__PURE__ */ (0,
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "addFile-error-close-button", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
679
797
|
"button",
|
|
680
798
|
{
|
|
681
799
|
className: "selectedFilesLinkButton error-close",
|
|
@@ -683,7 +801,7 @@ var SelectedFiles = ({
|
|
|
683
801
|
removeError();
|
|
684
802
|
},
|
|
685
803
|
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelande` : `Close error message`,
|
|
686
|
-
children: /* @__PURE__ */ (0,
|
|
804
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
687
805
|
"svg",
|
|
688
806
|
{
|
|
689
807
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -691,7 +809,7 @@ var SelectedFiles = ({
|
|
|
691
809
|
height: "14",
|
|
692
810
|
viewBox: "0 0 14 14",
|
|
693
811
|
fill: "none",
|
|
694
|
-
children: /* @__PURE__ */ (0,
|
|
812
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
695
813
|
"path",
|
|
696
814
|
{
|
|
697
815
|
d: "M0.75 12.75L12.75 0.75M0.75 0.75L12.75 12.75",
|
|
@@ -705,15 +823,15 @@ var SelectedFiles = ({
|
|
|
705
823
|
}
|
|
706
824
|
) })
|
|
707
825
|
] }) }),
|
|
708
|
-
questionObject.files.length > 0 && /* @__PURE__ */ (0,
|
|
826
|
+
questionObject.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
709
827
|
const indicatorfileName = file.FileName;
|
|
710
828
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
711
829
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
712
830
|
const fileType = file.FileName.split(".").pop();
|
|
713
831
|
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
714
|
-
return /* @__PURE__ */ (0,
|
|
715
|
-
/* @__PURE__ */ (0,
|
|
716
|
-
/* @__PURE__ */ (0,
|
|
832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "fileInListContainer", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "fileInList", children: [
|
|
833
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "fileItem", children: [
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", className: "uploadedDot", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
717
835
|
"svg",
|
|
718
836
|
{
|
|
719
837
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -721,7 +839,7 @@ var SelectedFiles = ({
|
|
|
721
839
|
height: "8",
|
|
722
840
|
viewBox: "0 0 8 8",
|
|
723
841
|
fill: "none",
|
|
724
|
-
children: /* @__PURE__ */ (0,
|
|
842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
725
843
|
"path",
|
|
726
844
|
{
|
|
727
845
|
d: "M1 4.65913L2.8 6.45913L7 1.35913",
|
|
@@ -732,20 +850,20 @@ var SelectedFiles = ({
|
|
|
732
850
|
)
|
|
733
851
|
}
|
|
734
852
|
) }) }),
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Col, { children: windowWidth < 768 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "mobileFirstFileName", children: [
|
|
736
854
|
mobileFirstFileName,
|
|
737
855
|
" (",
|
|
738
856
|
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
739
857
|
" ",
|
|
740
858
|
"MB)"
|
|
741
|
-
] }) : /* @__PURE__ */ (0,
|
|
859
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "desktopFileName", children: [
|
|
742
860
|
file.FileName,
|
|
743
861
|
" (",
|
|
744
|
-
/* @__PURE__ */ (0,
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "fileSizeText", children: file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB` }),
|
|
745
863
|
" ",
|
|
746
864
|
")"
|
|
747
865
|
] }) }),
|
|
748
|
-
/* @__PURE__ */ (0,
|
|
866
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
749
867
|
"button",
|
|
750
868
|
{
|
|
751
869
|
className: "selectedFilesLinkButton",
|
|
@@ -755,17 +873,17 @@ var SelectedFiles = ({
|
|
|
755
873
|
}
|
|
756
874
|
) })
|
|
757
875
|
] }),
|
|
758
|
-
showIndicator && /* @__PURE__ */ (0,
|
|
759
|
-
/* @__PURE__ */ (0,
|
|
876
|
+
showIndicator && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Col, { style: { width: "100%", padding: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IndicatorStandard_default, { filename: indicatorfileName }) }) }),
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap.Col, { className: "makeSpace" }) })
|
|
760
878
|
] }, index) }) }) }, `file-${file.FileName}-${index}`) });
|
|
761
879
|
}) }),
|
|
762
|
-
/* @__PURE__ */ (0,
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: theDiv, className: "pts-clipboard-container" })
|
|
763
881
|
] });
|
|
764
882
|
};
|
|
765
883
|
var SelectedFilesStandard_default = SelectedFiles;
|
|
766
884
|
|
|
767
885
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
768
|
-
var
|
|
886
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
769
887
|
var AddFiles = ({
|
|
770
888
|
questionObject,
|
|
771
889
|
handleQuestionInputChange = (e, questionObject2) => {
|
|
@@ -779,6 +897,7 @@ var AddFiles = ({
|
|
|
779
897
|
allowedTotalFileSize = 20971520
|
|
780
898
|
// 20MB = (1024 * 1024) * 20
|
|
781
899
|
}) => {
|
|
900
|
+
var _a, _b;
|
|
782
901
|
if (allowedFileTypes.length < 1) {
|
|
783
902
|
allowedFileTypes = [
|
|
784
903
|
"pdf",
|
|
@@ -803,26 +922,26 @@ var AddFiles = ({
|
|
|
803
922
|
const errorId = `error-${questionObject.id}`;
|
|
804
923
|
const labelId = `label-${questionObject.id}`;
|
|
805
924
|
const maxSizeMB = Math.round(allowedTotalFileSize / 1048576);
|
|
806
|
-
const [numberOfFiles, setNumberOfFiles] = (0,
|
|
807
|
-
const [totalFileSize, setTotalFileSize] = (0,
|
|
808
|
-
const [errorMessageAddingFile, setErrorMessageAddingFile] = (0,
|
|
809
|
-
const [newFiles, setNewFiles] = (0,
|
|
810
|
-
const [dropFilesText, setDropFilesText] = (0,
|
|
811
|
-
(0,
|
|
925
|
+
const [numberOfFiles, setNumberOfFiles] = (0, import_react7.useState)(0);
|
|
926
|
+
const [totalFileSize, setTotalFileSize] = (0, import_react7.useState)(0);
|
|
927
|
+
const [errorMessageAddingFile, setErrorMessageAddingFile] = (0, import_react7.useState)([]);
|
|
928
|
+
const [newFiles, setNewFiles] = (0, import_react7.useState)([]);
|
|
929
|
+
const [dropFilesText, setDropFilesText] = (0, import_react7.useState)("Dra och sl\xE4pp dina filer h\xE4r");
|
|
930
|
+
(0, import_react7.useEffect)(() => {
|
|
812
931
|
if (activatedLanguage === "sv") {
|
|
813
932
|
setDropFilesText("Dra och sl\xE4pp dina filer h\xE4r");
|
|
814
933
|
} else {
|
|
815
934
|
setDropFilesText("Drag and drop your files here");
|
|
816
935
|
}
|
|
817
936
|
}, [activatedLanguage]);
|
|
818
|
-
(0,
|
|
937
|
+
(0, import_react7.useEffect)(() => {
|
|
819
938
|
if (questionObject.files && questionObject.files.length > 0) {
|
|
820
939
|
setNumberOfFiles(questionObject.files.length);
|
|
821
940
|
}
|
|
822
941
|
}, []);
|
|
823
|
-
const onDrop = (0,
|
|
942
|
+
const onDrop = (0, import_react7.useCallback)(
|
|
824
943
|
(acceptedFiles) => {
|
|
825
|
-
var
|
|
944
|
+
var _a2, _b2, _c;
|
|
826
945
|
const validationErrors = [];
|
|
827
946
|
const validFiles = [];
|
|
828
947
|
const currentTotalFileSize = (questionObject.files || []).reduce(
|
|
@@ -830,7 +949,7 @@ var AddFiles = ({
|
|
|
830
949
|
0
|
|
831
950
|
);
|
|
832
951
|
setTotalFileSize(currentTotalFileSize);
|
|
833
|
-
if ((((
|
|
952
|
+
if ((((_a2 = questionObject.files) == null ? void 0 : _a2.length) || 0) >= allowedNumberOfFiles) {
|
|
834
953
|
acceptedFiles.forEach((file) => {
|
|
835
954
|
validationErrors.push({
|
|
836
955
|
FileName: file.name,
|
|
@@ -843,7 +962,7 @@ var AddFiles = ({
|
|
|
843
962
|
}
|
|
844
963
|
let accumulatedNewSize = 0;
|
|
845
964
|
for (const file of acceptedFiles) {
|
|
846
|
-
const fileExtension = ((
|
|
965
|
+
const fileExtension = ((_b2 = file.name.split(".").pop()) == null ? void 0 : _b2.toLowerCase()) || "";
|
|
847
966
|
if (!allowedFileTypes.includes(fileExtension)) {
|
|
848
967
|
validationErrors.push({
|
|
849
968
|
FileName: file.name,
|
|
@@ -910,7 +1029,7 @@ var AddFiles = ({
|
|
|
910
1029
|
reader.readAsDataURL(file);
|
|
911
1030
|
});
|
|
912
1031
|
};
|
|
913
|
-
(0,
|
|
1032
|
+
(0, import_react7.useEffect)(() => {
|
|
914
1033
|
if (newFiles.length > 0) {
|
|
915
1034
|
const currentFiles = questionObject.files ? questionObject.files : [];
|
|
916
1035
|
const e = {
|
|
@@ -937,9 +1056,9 @@ var AddFiles = ({
|
|
|
937
1056
|
const handleRemoveErrors = () => {
|
|
938
1057
|
setErrorMessageAddingFile([]);
|
|
939
1058
|
};
|
|
940
|
-
return /* @__PURE__ */ (0,
|
|
941
|
-
!showPreview && visible && /* @__PURE__ */ (0,
|
|
942
|
-
questionObject.aboutText && /* @__PURE__ */ (0,
|
|
1059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1060
|
+
!showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "root-question addFile-question-container", id: `question-${questionObject.id}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { role: "group", children: [
|
|
1061
|
+
questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
943
1062
|
"p",
|
|
944
1063
|
{
|
|
945
1064
|
id: aboutId,
|
|
@@ -949,19 +1068,29 @@ var AddFiles = ({
|
|
|
949
1068
|
),
|
|
950
1069
|
children: [
|
|
951
1070
|
questionObject.aboutText,
|
|
952
|
-
questionObject.isQuestionMandatory && /* @__PURE__ */ (0,
|
|
1071
|
+
questionObject.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
|
|
953
1072
|
" ",
|
|
954
1073
|
"*"
|
|
955
1074
|
] })
|
|
956
1075
|
]
|
|
957
1076
|
}
|
|
958
1077
|
),
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1078
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1079
|
+
ValidationMessage_default,
|
|
1080
|
+
{
|
|
1081
|
+
showValidationSummary: (_a = questionObject.hasValidationError) != null ? _a : false,
|
|
1082
|
+
validationId: errorId,
|
|
1083
|
+
validationMessesege: (_b = questionObject.validationDefaultMessesege) != null ? _b : "",
|
|
1084
|
+
activatedLanguage,
|
|
1085
|
+
extraCssClass: "error addfileserror"
|
|
1086
|
+
}
|
|
1087
|
+
),
|
|
1088
|
+
questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1090
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
|
|
963
1092
|
] }),
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
1093
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
965
1094
|
ExploreFilesStandard_default,
|
|
966
1095
|
{
|
|
967
1096
|
FilesSelected: onDrop,
|
|
@@ -977,7 +1106,7 @@ var AddFiles = ({
|
|
|
977
1106
|
removeUploadErrors: handleRemoveErrors
|
|
978
1107
|
}
|
|
979
1108
|
),
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
981
1110
|
DropFilesStandard_default,
|
|
982
1111
|
{
|
|
983
1112
|
FilesSelected: onDrop,
|
|
@@ -985,7 +1114,7 @@ var AddFiles = ({
|
|
|
985
1114
|
language: activatedLanguage
|
|
986
1115
|
}
|
|
987
1116
|
),
|
|
988
|
-
/* @__PURE__ */ (0,
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
989
1118
|
SelectedFilesStandard_default,
|
|
990
1119
|
{
|
|
991
1120
|
questionObject,
|
|
@@ -1000,7 +1129,7 @@ var AddFiles = ({
|
|
|
1000
1129
|
}
|
|
1001
1130
|
)
|
|
1002
1131
|
] }) }),
|
|
1003
|
-
showPreview && /* @__PURE__ */ (0,
|
|
1132
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PreviewAddFiles, { activatedLanguage, questionObject })
|
|
1004
1133
|
] });
|
|
1005
1134
|
};
|
|
1006
1135
|
var AddFilesStandard_default = AddFiles;
|
|
@@ -1009,30 +1138,30 @@ var PreviewAddFiles = ({
|
|
|
1009
1138
|
activatedLanguage
|
|
1010
1139
|
}) => {
|
|
1011
1140
|
const previewId = `preview-${questionObject.Id}`;
|
|
1012
|
-
return /* @__PURE__ */ (0,
|
|
1013
|
-
/* @__PURE__ */ (0,
|
|
1014
|
-
questionObject.files && questionObject.files.length > 0 ? /* @__PURE__ */ (0,
|
|
1015
|
-
return /* @__PURE__ */ (0,
|
|
1016
|
-
}) }) }) : /* @__PURE__ */ (0,
|
|
1141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { id: `question-${previewId}`, children: questionObject.questionLabel ? questionObject.questionLabel : activatedLanguage === "en" ? "Attached files" : "Bifogade filer" }),
|
|
1143
|
+
questionObject.files && questionObject.files.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { className: "pts-addFiles-answer", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { "aria-labelledby": previewId, className: "pts-preview-answer-list", children: questionObject.files.map((file, index) => {
|
|
1144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
|
|
1145
|
+
}) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No attached files" : "Inga bifogade filer" })
|
|
1017
1146
|
] });
|
|
1018
1147
|
};
|
|
1019
1148
|
|
|
1020
1149
|
// src/components/input-components/SingleCheckboxStandard/SingleCheckboxStandard.tsx
|
|
1021
|
-
var
|
|
1022
|
-
var
|
|
1150
|
+
var import_react8 = require("react");
|
|
1151
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1023
1152
|
var SingleCheckbox = ({
|
|
1024
1153
|
question,
|
|
1025
1154
|
handleQuestionInputChange,
|
|
1026
1155
|
showPreview = false,
|
|
1027
1156
|
activatedLanguage = "sv"
|
|
1028
1157
|
}) => {
|
|
1029
|
-
var _a, _b;
|
|
1158
|
+
var _a, _b, _c, _d;
|
|
1030
1159
|
const questionId = `question-${question.id}`;
|
|
1031
1160
|
const inputId = `checkbox-${question.id}`;
|
|
1032
1161
|
const aboutId = `about-${question.id}`;
|
|
1033
1162
|
const errorId = `error-${question.id}`;
|
|
1034
|
-
const [checked, setChecked] = (0,
|
|
1035
|
-
(0,
|
|
1163
|
+
const [checked, setChecked] = (0, import_react8.useState)(false);
|
|
1164
|
+
(0, import_react8.useEffect)(() => {
|
|
1036
1165
|
if (question.answer && question.answer === "true") {
|
|
1037
1166
|
setChecked(true);
|
|
1038
1167
|
} else {
|
|
@@ -1045,10 +1174,10 @@ var SingleCheckbox = ({
|
|
|
1045
1174
|
const e = { target: { value: answer } };
|
|
1046
1175
|
handleQuestionInputChange(e, question);
|
|
1047
1176
|
};
|
|
1048
|
-
return /* @__PURE__ */ (0,
|
|
1049
|
-
!showPreview && question.visible && /* @__PURE__ */ (0,
|
|
1050
|
-
/* @__PURE__ */ (0,
|
|
1051
|
-
/* @__PURE__ */ (0,
|
|
1177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1178
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { id: questionId, className: "pts-root-question pts-singleCheckbox-container", children: [
|
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "pts-singleCheckbox-row", children: [
|
|
1180
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1052
1181
|
"input",
|
|
1053
1182
|
{
|
|
1054
1183
|
type: "checkbox",
|
|
@@ -1066,11 +1195,11 @@ var SingleCheckbox = ({
|
|
|
1066
1195
|
"aria-errormessage": question.hasValidationError ? errorId : void 0
|
|
1067
1196
|
}
|
|
1068
1197
|
),
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
1070
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0,
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: `${inputId}`, children: question.questionLabel }),
|
|
1199
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
1071
1200
|
" "
|
|
1072
1201
|
] }),
|
|
1073
|
-
question.aboutText && /* @__PURE__ */ (0,
|
|
1202
|
+
question.aboutText && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1074
1203
|
"div",
|
|
1075
1204
|
{
|
|
1076
1205
|
id: aboutId,
|
|
@@ -1079,15 +1208,18 @@ var SingleCheckbox = ({
|
|
|
1079
1208
|
}
|
|
1080
1209
|
),
|
|
1081
1210
|
" ",
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1212
|
+
ValidationMessage_default,
|
|
1213
|
+
{
|
|
1214
|
+
showValidationSummary: (_c = question.hasValidationError) != null ? _c : false,
|
|
1215
|
+
validationId: errorId,
|
|
1216
|
+
validationMessesege: (_d = question.validationDefaultMessesege) != null ? _d : "",
|
|
1217
|
+
activatedLanguage
|
|
1218
|
+
}
|
|
1219
|
+
)
|
|
1088
1220
|
] }),
|
|
1089
1221
|
" ",
|
|
1090
|
-
showPreview && /* @__PURE__ */ (0,
|
|
1222
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PreviewSingleCheckbox, { activatedLanguage, question })
|
|
1091
1223
|
] });
|
|
1092
1224
|
};
|
|
1093
1225
|
var SingleCheckboxStandard_default = SingleCheckbox;
|
|
@@ -1097,9 +1229,9 @@ var PreviewSingleCheckbox = ({
|
|
|
1097
1229
|
}) => {
|
|
1098
1230
|
var _a, _b;
|
|
1099
1231
|
const previewId = `preview-${question.id}`;
|
|
1100
|
-
return /* @__PURE__ */ (0,
|
|
1101
|
-
/* @__PURE__ */ (0,
|
|
1102
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0,
|
|
1232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1234
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { className: "pts-singleCheckbox-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer === "false" ? activatedLanguage === "sv" ? "Nej" : "No" : activatedLanguage === "sv" ? "Ja" : "Yes" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1103
1235
|
"dd",
|
|
1104
1236
|
{
|
|
1105
1237
|
className: "pts-singleCheckbox-preview pts-root-answer",
|
|
@@ -1110,154 +1242,6 @@ var PreviewSingleCheckbox = ({
|
|
|
1110
1242
|
] });
|
|
1111
1243
|
};
|
|
1112
1244
|
|
|
1113
|
-
// src/components/input-components/DropdownStandard/DropdownStandard.tsx
|
|
1114
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1115
|
-
var CustomDropdownStandard = ({
|
|
1116
|
-
question,
|
|
1117
|
-
handleQuestionInputChange,
|
|
1118
|
-
showPreview = false
|
|
1119
|
-
}) => {
|
|
1120
|
-
var _a;
|
|
1121
|
-
const questionId = `question-${question.id}`;
|
|
1122
|
-
const selectId = `select-${question.id}`;
|
|
1123
|
-
const errorId = `error-${question.id}`;
|
|
1124
|
-
const handleInputChange = (event) => {
|
|
1125
|
-
const e = { target: { value: event.target.value } };
|
|
1126
|
-
handleQuestionInputChange(e, question);
|
|
1127
|
-
};
|
|
1128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1129
|
-
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "pts-root-question pts-dropdown-container", id: questionId, children: [
|
|
1130
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { htmlFor: selectId, children: [
|
|
1131
|
-
question.questionLabel,
|
|
1132
|
-
" ",
|
|
1133
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
1134
|
-
] }),
|
|
1135
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1136
|
-
"select",
|
|
1137
|
-
{
|
|
1138
|
-
id: selectId,
|
|
1139
|
-
name: `name-${question.id}`,
|
|
1140
|
-
value: question.answer || "",
|
|
1141
|
-
onChange: handleInputChange,
|
|
1142
|
-
"aria-required": question.isQuestionMandatory,
|
|
1143
|
-
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
1144
|
-
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
1145
|
-
children: [
|
|
1146
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "V\xE4lj ett alternativ" }),
|
|
1147
|
-
(_a = question.options) == null ? void 0 : _a.map((option, index) => {
|
|
1148
|
-
if (option.value === question.answer) {
|
|
1149
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: option.value, selected: true, children: option.label }, index);
|
|
1150
|
-
} else {
|
|
1151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: option.value, children: option.label }, index);
|
|
1152
|
-
}
|
|
1153
|
-
})
|
|
1154
|
-
]
|
|
1155
|
-
}
|
|
1156
|
-
),
|
|
1157
|
-
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
1158
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1159
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1160
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
1161
|
-
] })
|
|
1162
|
-
] }),
|
|
1163
|
-
showPreview && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PreviewDropdown, { question })
|
|
1164
|
-
] });
|
|
1165
|
-
};
|
|
1166
|
-
var DropdownStandard_default = CustomDropdownStandard;
|
|
1167
|
-
var PreviewDropdown = ({ question }) => {
|
|
1168
|
-
var _a, _b;
|
|
1169
|
-
const previewId = `preview-${question.id}`;
|
|
1170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1171
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1172
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { className: "pts-dropdown-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1173
|
-
"dd",
|
|
1174
|
-
{
|
|
1175
|
-
className: "pts-dropdown-preview pts-root-answer no-answer-preview-page",
|
|
1176
|
-
id: `answer-${previewId}`,
|
|
1177
|
-
children: "Inget svar"
|
|
1178
|
-
}
|
|
1179
|
-
)
|
|
1180
|
-
] });
|
|
1181
|
-
};
|
|
1182
|
-
|
|
1183
|
-
// src/components/input-components/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
1184
|
-
var import_react8 = require("react");
|
|
1185
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1186
|
-
var MultipleCheckboxes = ({
|
|
1187
|
-
question,
|
|
1188
|
-
handleQuestionInputChange,
|
|
1189
|
-
showPreview = false,
|
|
1190
|
-
activatedLanguage = "sv"
|
|
1191
|
-
}) => {
|
|
1192
|
-
var _a;
|
|
1193
|
-
const questionId = `question-${question.id}`;
|
|
1194
|
-
const [checkedValues, setCheckedValues] = (0, import_react8.useState)([]);
|
|
1195
|
-
(0, import_react8.useEffect)(() => {
|
|
1196
|
-
var _a2;
|
|
1197
|
-
const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
|
|
1198
|
-
var _a3;
|
|
1199
|
-
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
|
|
1200
|
-
}).map((option) => option.label)) || [];
|
|
1201
|
-
console.log("Initial values:", initialValues);
|
|
1202
|
-
setCheckedValues(initialValues);
|
|
1203
|
-
}, [question.answer, question.options]);
|
|
1204
|
-
const handleInputChange = (event, optionValue) => {
|
|
1205
|
-
let updatedValues = [...checkedValues];
|
|
1206
|
-
if (updatedValues.includes(optionValue)) {
|
|
1207
|
-
updatedValues = updatedValues.filter((val) => val !== optionValue);
|
|
1208
|
-
} else {
|
|
1209
|
-
updatedValues.push(optionValue);
|
|
1210
|
-
}
|
|
1211
|
-
setCheckedValues(updatedValues);
|
|
1212
|
-
const e = { target: { value: updatedValues.toString() } };
|
|
1213
|
-
handleQuestionInputChange(e, question);
|
|
1214
|
-
};
|
|
1215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1216
|
-
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("fieldset", { children: [
|
|
1217
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("legend", { className: "multipleCheckboxes-legend", id: `label-${questionId}`, children: [
|
|
1218
|
-
question.questionLabel,
|
|
1219
|
-
" ",
|
|
1220
|
-
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
1221
|
-
" "
|
|
1222
|
-
] }),
|
|
1223
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1224
|
-
" ",
|
|
1225
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1226
|
-
"input",
|
|
1227
|
-
{
|
|
1228
|
-
type: "checkbox",
|
|
1229
|
-
name: `${question.id}-option`,
|
|
1230
|
-
id: `${question.id}-option-${index}`,
|
|
1231
|
-
value: option.label,
|
|
1232
|
-
checked: checkedValues.includes(option.label),
|
|
1233
|
-
onChange: (e) => handleInputChange(e, option.label),
|
|
1234
|
-
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
1235
|
-
}
|
|
1236
|
-
),
|
|
1237
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: `${question.id}-option-${index}`, children: option.label })
|
|
1238
|
-
] }) }, index)) })
|
|
1239
|
-
] }) }),
|
|
1240
|
-
" ",
|
|
1241
|
-
showPreview && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PrevieMultipleCheckboxes, { activatedLanguage, question })
|
|
1242
|
-
] });
|
|
1243
|
-
};
|
|
1244
|
-
var MultipleCheckboxesStandard_default = MultipleCheckboxes;
|
|
1245
|
-
var PrevieMultipleCheckboxes = ({
|
|
1246
|
-
question,
|
|
1247
|
-
activatedLanguage
|
|
1248
|
-
}) => {
|
|
1249
|
-
var _a, _b;
|
|
1250
|
-
const previewId = `preview-${question.id}`;
|
|
1251
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1252
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1253
|
-
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: question.options[0].label }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
1254
|
-
var _a2;
|
|
1255
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
1256
|
-
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
1257
|
-
" "
|
|
1258
|
-
] });
|
|
1259
|
-
};
|
|
1260
|
-
|
|
1261
1245
|
// src/helpers/hasQuestionValidationError/hasQuestionValidationError.tsx
|
|
1262
1246
|
var import_date_fns = require("date-fns");
|
|
1263
1247
|
var hasQuestionValidationError = (question, questions) => {
|
|
@@ -2033,14 +2017,6 @@ var QuestionRenderer = ({
|
|
|
2033
2017
|
handleQuestionInputChange,
|
|
2034
2018
|
showPreview
|
|
2035
2019
|
}
|
|
2036
|
-
),
|
|
2037
|
-
question.questionType === "Dropdown" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2038
|
-
DropdownStandard_default,
|
|
2039
|
-
{
|
|
2040
|
-
question,
|
|
2041
|
-
handleQuestionInputChange,
|
|
2042
|
-
showPreview
|
|
2043
|
-
}
|
|
2044
2020
|
)
|
|
2045
2021
|
] });
|
|
2046
2022
|
};
|
|
@@ -2058,11 +2034,12 @@ var QuestionGroup = ({
|
|
|
2058
2034
|
showPreview = false,
|
|
2059
2035
|
markQuestionAsDisplayed
|
|
2060
2036
|
}) => {
|
|
2061
|
-
var _a;
|
|
2037
|
+
var _a, _b, _c;
|
|
2062
2038
|
if (!questions || questions.length === 0) {
|
|
2063
2039
|
return null;
|
|
2064
2040
|
}
|
|
2065
2041
|
const firstQuestion = questions[0];
|
|
2042
|
+
const errorId = firstQuestion.id + "-error";
|
|
2066
2043
|
const groupMandatory = (_a = firstQuestion.validationType) == null ? void 0 : _a.find((e) => e.startsWith("groupCheck-"));
|
|
2067
2044
|
(0, import_react12.useEffect)(() => {
|
|
2068
2045
|
questions.forEach((question) => {
|
|
@@ -2094,7 +2071,7 @@ var QuestionGroup = ({
|
|
|
2094
2071
|
"aria-describedby": firstQuestion.hasValidationError ? `${firstQuestion.id}-error` : void 0,
|
|
2095
2072
|
children: [
|
|
2096
2073
|
legendLabel && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("legend", { children: [
|
|
2097
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", {
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
2098
2075
|
legendLabel,
|
|
2099
2076
|
groupMandatory && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
2100
2077
|
] }),
|
|
@@ -2103,10 +2080,15 @@ var QuestionGroup = ({
|
|
|
2103
2080
|
firstQuestion.validationDefaultMessesege
|
|
2104
2081
|
] })
|
|
2105
2082
|
] }),
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2083
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2084
|
+
ValidationMessage_default,
|
|
2085
|
+
{
|
|
2086
|
+
showValidationSummary: (_b = firstQuestion.hasValidationError) != null ? _b : false,
|
|
2087
|
+
validationId: errorId,
|
|
2088
|
+
validationMessesege: (_c = firstQuestion.validationDefaultMessesege) != null ? _c : "",
|
|
2089
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
2090
|
+
}
|
|
2091
|
+
),
|
|
2110
2092
|
groupQuestions
|
|
2111
2093
|
]
|
|
2112
2094
|
}
|
|
@@ -2203,86 +2185,89 @@ var CookieBanner_default = CookieBanner;
|
|
|
2203
2185
|
// src/components/layout/FooterStandard/FooterStandard.tsx
|
|
2204
2186
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2205
2187
|
var Footer = ({ activatedLanguage = "sv" }) => {
|
|
2206
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.
|
|
2207
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
"
|
|
2211
|
-
className: "pts-footer-logo",
|
|
2212
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2213
|
-
width: "278",
|
|
2214
|
-
height: "72",
|
|
2215
|
-
viewBox: "0 0 278 72",
|
|
2216
|
-
fill: "none",
|
|
2217
|
-
children: [
|
|
2218
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2219
|
-
"path",
|
|
2220
|
-
{
|
|
2221
|
-
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",
|
|
2222
|
-
fill: "white"
|
|
2223
|
-
}
|
|
2224
|
-
),
|
|
2225
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2226
|
-
"path",
|
|
2227
|
-
{
|
|
2228
|
-
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",
|
|
2229
|
-
fill: "white"
|
|
2230
|
-
}
|
|
2231
|
-
)
|
|
2232
|
-
]
|
|
2233
|
-
}
|
|
2234
|
-
),
|
|
2235
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("nav", { className: "pts-footer-linkList", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ul", { children: [
|
|
2236
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2237
|
-
"a",
|
|
2238
|
-
{
|
|
2239
|
-
href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
|
|
2240
|
-
target: "_blank",
|
|
2241
|
-
rel: "noopener noreferrer",
|
|
2242
|
-
children: [
|
|
2243
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
|
|
2244
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
|
|
2245
|
-
]
|
|
2246
|
-
}
|
|
2247
|
-
) }),
|
|
2248
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2249
|
-
"a",
|
|
2250
|
-
{
|
|
2251
|
-
href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
|
|
2252
|
-
target: "_blank",
|
|
2253
|
-
rel: "noopener noreferrer",
|
|
2254
|
-
children: [
|
|
2255
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
|
|
2256
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
|
|
2257
|
-
]
|
|
2258
|
-
}
|
|
2259
|
-
) }),
|
|
2260
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2261
|
-
"a",
|
|
2262
|
-
{
|
|
2263
|
-
href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
|
|
2264
|
-
target: "_blank",
|
|
2265
|
-
rel: "noopener noreferrer",
|
|
2266
|
-
children: [
|
|
2267
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
|
|
2268
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
|
|
2269
|
-
]
|
|
2270
|
-
}
|
|
2271
|
-
) }),
|
|
2272
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2273
|
-
"a",
|
|
2188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("footer", { className: "pts-footer-container", children: [
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "pts-footer-slogan-text-container", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "pts-footer-slogan-text", children: activatedLanguage === "sv" ? "S\xE4ker och tillg\xE4nglig kommunikation f\xF6r Sverige" : "Secure and accessible communication for Sweden" }) }),
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "pts-footer-content", children: [
|
|
2191
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2192
|
+
"svg",
|
|
2274
2193
|
{
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2194
|
+
"aria-label": activatedLanguage === "en" ? "PTS logotype" : "PTS logotyp",
|
|
2195
|
+
className: "pts-footer-logo",
|
|
2196
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2197
|
+
width: "278",
|
|
2198
|
+
height: "72",
|
|
2199
|
+
viewBox: "0 0 278 72",
|
|
2200
|
+
fill: "none",
|
|
2278
2201
|
children: [
|
|
2279
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2280
|
-
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2203
|
+
"path",
|
|
2204
|
+
{
|
|
2205
|
+
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",
|
|
2206
|
+
fill: "white"
|
|
2207
|
+
}
|
|
2208
|
+
),
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2210
|
+
"path",
|
|
2211
|
+
{
|
|
2212
|
+
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",
|
|
2213
|
+
fill: "white"
|
|
2214
|
+
}
|
|
2215
|
+
)
|
|
2281
2216
|
]
|
|
2282
2217
|
}
|
|
2283
|
-
)
|
|
2284
|
-
|
|
2285
|
-
|
|
2218
|
+
),
|
|
2219
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("nav", { className: "pts-footer-linkList", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ul", { children: [
|
|
2220
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2221
|
+
"a",
|
|
2222
|
+
{
|
|
2223
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
|
|
2224
|
+
target: "_blank",
|
|
2225
|
+
rel: "noopener noreferrer",
|
|
2226
|
+
children: [
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
|
|
2229
|
+
]
|
|
2230
|
+
}
|
|
2231
|
+
) }),
|
|
2232
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2233
|
+
"a",
|
|
2234
|
+
{
|
|
2235
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
|
|
2236
|
+
target: "_blank",
|
|
2237
|
+
rel: "noopener noreferrer",
|
|
2238
|
+
children: [
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
|
|
2241
|
+
]
|
|
2242
|
+
}
|
|
2243
|
+
) }),
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2245
|
+
"a",
|
|
2246
|
+
{
|
|
2247
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
|
|
2248
|
+
target: "_blank",
|
|
2249
|
+
rel: "noopener noreferrer",
|
|
2250
|
+
children: [
|
|
2251
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
|
|
2253
|
+
]
|
|
2254
|
+
}
|
|
2255
|
+
) }),
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2257
|
+
"a",
|
|
2258
|
+
{
|
|
2259
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
|
|
2260
|
+
target: "_blank",
|
|
2261
|
+
rel: "noopener noreferrer",
|
|
2262
|
+
children: [
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens in new tab)" : "PTS Kakor (\xF6ppnas i ny flik)" }),
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
|
|
2265
|
+
]
|
|
2266
|
+
}
|
|
2267
|
+
) })
|
|
2268
|
+
] }) })
|
|
2269
|
+
] })
|
|
2270
|
+
] });
|
|
2286
2271
|
};
|
|
2287
2272
|
var FooterStandard_default = Footer;
|
|
2288
2273
|
|
|
@@ -2683,7 +2668,7 @@ var Header = ({
|
|
|
2683
2668
|
if (activatedLanguage === "sv") return "English";
|
|
2684
2669
|
else return "Svenska";
|
|
2685
2670
|
};
|
|
2686
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("header", { className: "pts-header-container", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "pts-header-content", children: [
|
|
2687
2672
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pts-header-logo-container", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2688
2673
|
"a",
|
|
2689
2674
|
{
|
|
@@ -2694,7 +2679,7 @@ var Header = ({
|
|
|
2694
2679
|
children: activatedLanguage === "en" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Logo_en, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Logo_sv, {}) })
|
|
2695
2680
|
}
|
|
2696
2681
|
) }),
|
|
2697
|
-
useLanguage && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2682
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pts-header-navigation-container", children: useLanguage && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2698
2683
|
"button",
|
|
2699
2684
|
{
|
|
2700
2685
|
lang: activatedLanguage === "en" ? "en" : "sv",
|
|
@@ -2707,8 +2692,8 @@ var Header = ({
|
|
|
2707
2692
|
activatedLanguage === "sv" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: "Change language to English" })
|
|
2708
2693
|
]
|
|
2709
2694
|
}
|
|
2710
|
-
)
|
|
2711
|
-
] });
|
|
2695
|
+
) })
|
|
2696
|
+
] }) });
|
|
2712
2697
|
};
|
|
2713
2698
|
var HeaderStandard_default = Header;
|
|
2714
2699
|
|
|
@@ -2966,7 +2951,7 @@ var EditPreviewLink = ({
|
|
|
2966
2951
|
changeStepHandler,
|
|
2967
2952
|
activatedLanguage = "sv"
|
|
2968
2953
|
}) => {
|
|
2969
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime25.
|
|
2954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2970
2955
|
"a",
|
|
2971
2956
|
{
|
|
2972
2957
|
href: "#",
|
|
@@ -2975,30 +2960,7 @@ var EditPreviewLink = ({
|
|
|
2975
2960
|
e.preventDefault();
|
|
2976
2961
|
changeStepHandler(step.step);
|
|
2977
2962
|
},
|
|
2978
|
-
children:
|
|
2979
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2980
|
-
"svg",
|
|
2981
|
-
{
|
|
2982
|
-
"aria-hidden": "true",
|
|
2983
|
-
focusable: "false",
|
|
2984
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2985
|
-
width: "16",
|
|
2986
|
-
height: "16",
|
|
2987
|
-
viewBox: "0 0 16 16",
|
|
2988
|
-
fill: "none",
|
|
2989
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2990
|
-
"path",
|
|
2991
|
-
{
|
|
2992
|
-
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",
|
|
2993
|
-
stroke: "#6E3282",
|
|
2994
|
-
strokeLinecap: "round",
|
|
2995
|
-
strokeLinejoin: "round"
|
|
2996
|
-
}
|
|
2997
|
-
)
|
|
2998
|
-
}
|
|
2999
|
-
),
|
|
3000
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pts-edit-step-text", children: activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}` })
|
|
3001
|
-
]
|
|
2963
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pts-edit-step-text", children: activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}` })
|
|
3002
2964
|
}
|
|
3003
2965
|
) });
|
|
3004
2966
|
};
|
|
@@ -3134,7 +3096,7 @@ var ValidationErrorSummaryList = ({
|
|
|
3134
3096
|
if (container) {
|
|
3135
3097
|
container.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
3136
3098
|
setTimeout(() => {
|
|
3137
|
-
const input = container.querySelector("input, textarea, select");
|
|
3099
|
+
const input = container.querySelector("input, textarea, select, button");
|
|
3138
3100
|
if (input) {
|
|
3139
3101
|
input.focus();
|
|
3140
3102
|
}
|
|
@@ -3178,7 +3140,7 @@ var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
|
3178
3140
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3179
3141
|
var FormStatusMessagesScreenReader = ({ formStatus }) => {
|
|
3180
3142
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3181
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "mandatoryAsterisk", children: "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3143
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "pts-root-mandatoryAsterisk", children: "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3182
3144
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
|
|
3183
3145
|
] });
|
|
3184
3146
|
};
|
|
@@ -3188,7 +3150,6 @@ var FormStatusMessagesScreenReader_default = FormStatusMessagesScreenReader;
|
|
|
3188
3150
|
AddFilesStandard,
|
|
3189
3151
|
CheckboxGroupStandard,
|
|
3190
3152
|
CookieBanner,
|
|
3191
|
-
DropdownStandard,
|
|
3192
3153
|
EditPreviewLinkStandard,
|
|
3193
3154
|
FooterStandard,
|
|
3194
3155
|
FormStatusMessagesScreenReader,
|