optimized-react-component-library-xyz123 0.1.46 → 0.1.48
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +208 -111
- package/dist/index.mjs +208 -111
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -222,7 +222,7 @@ declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPre
|
|
|
222
222
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
223
223
|
|
|
224
224
|
interface EditPreviewLinkProps {
|
|
225
|
-
step:
|
|
225
|
+
step: IStepObject;
|
|
226
226
|
changeStepHandler: any;
|
|
227
227
|
activatedLanguage?: string;
|
|
228
228
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -222,7 +222,7 @@ declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPre
|
|
|
222
222
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
223
223
|
|
|
224
224
|
interface EditPreviewLinkProps {
|
|
225
|
-
step:
|
|
225
|
+
step: IStepObject;
|
|
226
226
|
changeStepHandler: any;
|
|
227
227
|
activatedLanguage?: string;
|
|
228
228
|
}
|
package/dist/index.js
CHANGED
|
@@ -119,10 +119,17 @@ var RadioMultipleStandard_default = InputRadio;
|
|
|
119
119
|
var PreviewRadio = ({ question }) => {
|
|
120
120
|
var _a, _b;
|
|
121
121
|
const previewId = `preview-${question.id}`;
|
|
122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
123
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
124
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
"dd",
|
|
126
|
+
{
|
|
127
|
+
className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
|
|
128
|
+
id: `answer-${previewId}`,
|
|
129
|
+
children: "Inget svar"
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] });
|
|
126
133
|
};
|
|
127
134
|
|
|
128
135
|
// src/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
@@ -159,7 +166,7 @@ var MultipleCheckboxes = ({
|
|
|
159
166
|
};
|
|
160
167
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
161
168
|
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { role: "group", "aria-labelledby": `label-${questionId}`, children: [
|
|
162
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h3", { id: `label-${questionId}`, children: [
|
|
163
170
|
question.questionLabel,
|
|
164
171
|
" ",
|
|
165
172
|
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
@@ -194,20 +201,14 @@ var PrevieMultipleCheckboxes = ({
|
|
|
194
201
|
}) => {
|
|
195
202
|
var _a, _b;
|
|
196
203
|
const previewId = `preview-${question.id}`;
|
|
197
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
198
|
-
"
|
|
199
|
-
{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var _a2;
|
|
206
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
207
|
-
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: option.label }, index)) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }) })
|
|
208
|
-
]
|
|
209
|
-
}
|
|
210
|
-
) });
|
|
204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
206
|
+
question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
207
|
+
var _a2;
|
|
208
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
209
|
+
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: option.label }, index)) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
210
|
+
" "
|
|
211
|
+
] });
|
|
211
212
|
};
|
|
212
213
|
|
|
213
214
|
// src/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.tsx
|
|
@@ -257,7 +258,7 @@ var InputTextarea = ({
|
|
|
257
258
|
"aria-required": question.isQuestionMandatory,
|
|
258
259
|
"aria-invalid": question.hasValidationError,
|
|
259
260
|
maxLength: ((_a = question.questionExtraAttribute) == null ? void 0 : _a.answerMaxLength) || defaultMaxLength,
|
|
260
|
-
"aria-describedby":
|
|
261
|
+
"aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
|
|
261
262
|
id: inputId
|
|
262
263
|
}
|
|
263
264
|
),
|
|
@@ -293,10 +294,17 @@ var PreviewTextarea = ({
|
|
|
293
294
|
}) => {
|
|
294
295
|
var _a, _b;
|
|
295
296
|
const previewId = `preview-${question.id}`;
|
|
296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
297
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
299
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
300
|
+
"dd",
|
|
301
|
+
{
|
|
302
|
+
className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
|
|
303
|
+
id: `answer-${previewId}`,
|
|
304
|
+
children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] });
|
|
300
308
|
};
|
|
301
309
|
|
|
302
310
|
// src/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.tsx
|
|
@@ -350,7 +358,7 @@ var TextFieldStandard = ({
|
|
|
350
358
|
disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
|
|
351
359
|
required: question.isQuestionMandatory,
|
|
352
360
|
"aria-required": question.isQuestionMandatory,
|
|
353
|
-
"aria-describedby":
|
|
361
|
+
"aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
|
|
354
362
|
"aria-invalid": question.hasValidationError,
|
|
355
363
|
"aria-errormessage": question.hasValidationError ? errorId : void 0
|
|
356
364
|
}
|
|
@@ -372,10 +380,17 @@ var PreviewTextField = ({
|
|
|
372
380
|
}) => {
|
|
373
381
|
var _a, _b;
|
|
374
382
|
const previewId = `preview-${question.id}`;
|
|
375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.
|
|
376
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("
|
|
377
|
-
|
|
378
|
-
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
384
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
385
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
386
|
+
"dd",
|
|
387
|
+
{
|
|
388
|
+
className: "pts-textField-preview pts-root-answer no-answer-preview-page",
|
|
389
|
+
id: `answer-${previewId}`,
|
|
390
|
+
children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
] });
|
|
379
394
|
};
|
|
380
395
|
|
|
381
396
|
// src/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.tsx
|
|
@@ -1836,30 +1851,40 @@ var EditPreviewLink = ({
|
|
|
1836
1851
|
changeStepHandler,
|
|
1837
1852
|
activatedLanguage = "sv"
|
|
1838
1853
|
}) => {
|
|
1839
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1851
|
-
"path",
|
|
1854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1855
|
+
"a",
|
|
1856
|
+
{
|
|
1857
|
+
href: "#",
|
|
1858
|
+
onClick: (e) => {
|
|
1859
|
+
e.preventDefault();
|
|
1860
|
+
changeStepHandler(step);
|
|
1861
|
+
},
|
|
1862
|
+
children: [
|
|
1863
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1864
|
+
"svg",
|
|
1852
1865
|
{
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1866
|
+
"aria-hidden": "true",
|
|
1867
|
+
focusable: "false",
|
|
1868
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1869
|
+
width: "16",
|
|
1870
|
+
height: "16",
|
|
1871
|
+
viewBox: "0 0 16 16",
|
|
1872
|
+
fill: "none",
|
|
1873
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1874
|
+
"path",
|
|
1875
|
+
{
|
|
1876
|
+
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",
|
|
1877
|
+
stroke: "#6E3282",
|
|
1878
|
+
strokeLinecap: "round",
|
|
1879
|
+
strokeLinejoin: "round"
|
|
1880
|
+
}
|
|
1881
|
+
)
|
|
1857
1882
|
}
|
|
1858
|
-
)
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1883
|
+
),
|
|
1884
|
+
activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}`
|
|
1885
|
+
]
|
|
1886
|
+
}
|
|
1887
|
+
) });
|
|
1863
1888
|
};
|
|
1864
1889
|
var EditPreviewLinkStandard_default = EditPreviewLink;
|
|
1865
1890
|
|
|
@@ -1897,7 +1922,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
|
|
|
1897
1922
|
}
|
|
1898
1923
|
),
|
|
1899
1924
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1900
|
-
"
|
|
1925
|
+
"nav",
|
|
1901
1926
|
{
|
|
1902
1927
|
className: "pts-footer-linkList",
|
|
1903
1928
|
"aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
|
|
@@ -2459,40 +2484,77 @@ var import_react10 = require("react");
|
|
|
2459
2484
|
var import_dompurify5 = __toESM(require("dompurify"));
|
|
2460
2485
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2461
2486
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
2462
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
"
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
"
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
viewBox: "0 0 12 10",
|
|
2481
|
-
fill: "none",
|
|
2482
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2483
|
-
"path",
|
|
2487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2488
|
+
"section",
|
|
2489
|
+
{
|
|
2490
|
+
className: "pts-textHeadlineAndBody-container",
|
|
2491
|
+
"aria-labelledby": "textHeadlineAndBody-headline",
|
|
2492
|
+
children: [
|
|
2493
|
+
data.headline && (0, import_react10.createElement)(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
|
|
2494
|
+
data.body && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
|
|
2495
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2496
|
+
"a",
|
|
2497
|
+
{
|
|
2498
|
+
href: link.url,
|
|
2499
|
+
target: "_blank",
|
|
2500
|
+
rel: "noopener noreferrer",
|
|
2501
|
+
"aria-label": link.ariaLabel,
|
|
2502
|
+
children: [
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2504
|
+
"svg",
|
|
2484
2505
|
{
|
|
2485
|
-
|
|
2486
|
-
|
|
2506
|
+
"aria-hidden": "true",
|
|
2507
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2508
|
+
width: "12",
|
|
2509
|
+
height: "10",
|
|
2510
|
+
viewBox: "0 0 12 10",
|
|
2511
|
+
fill: "none",
|
|
2512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2513
|
+
"path",
|
|
2514
|
+
{
|
|
2515
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
2516
|
+
fill: "#ffffff"
|
|
2517
|
+
}
|
|
2518
|
+
)
|
|
2487
2519
|
}
|
|
2488
|
-
)
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2520
|
+
) }),
|
|
2521
|
+
link.title
|
|
2522
|
+
]
|
|
2523
|
+
}
|
|
2524
|
+
) }, `more-info-${index}`)) }),
|
|
2525
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2526
|
+
"a",
|
|
2527
|
+
{
|
|
2528
|
+
href: data.linksForMoreInfo[0].url,
|
|
2529
|
+
target: "_blank",
|
|
2530
|
+
rel: "noopener noreferrer",
|
|
2531
|
+
"aria-label": data.linksForMoreInfo[0].ariaLabel,
|
|
2532
|
+
children: [
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2534
|
+
"svg",
|
|
2535
|
+
{
|
|
2536
|
+
"aria-hidden": "true",
|
|
2537
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2538
|
+
width: "12",
|
|
2539
|
+
height: "10",
|
|
2540
|
+
viewBox: "0 0 12 10",
|
|
2541
|
+
fill: "none",
|
|
2542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2543
|
+
"path",
|
|
2544
|
+
{
|
|
2545
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
2546
|
+
fill: "#ffffff"
|
|
2547
|
+
}
|
|
2548
|
+
)
|
|
2549
|
+
}
|
|
2550
|
+
) }),
|
|
2551
|
+
data.linksForMoreInfo[0].title
|
|
2552
|
+
]
|
|
2553
|
+
}
|
|
2554
|
+
)
|
|
2555
|
+
]
|
|
2556
|
+
}
|
|
2557
|
+
);
|
|
2496
2558
|
};
|
|
2497
2559
|
var TextHeadlineAndBodyStandard_default = TextHeadlineAndBody;
|
|
2498
2560
|
|
|
@@ -2557,7 +2619,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
|
2557
2619
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "pts-serviceHeadlineAndBody-container", children: [
|
|
2558
2620
|
data.mainHeadline && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
|
|
2559
2621
|
activeStep === 1 && data.ingressBody && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify6.default.sanitize(data.ingressBody) } }),
|
|
2560
|
-
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length >
|
|
2622
|
+
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
2561
2623
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2562
2624
|
"svg",
|
|
2563
2625
|
{
|
|
@@ -2577,7 +2639,28 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
|
2577
2639
|
}
|
|
2578
2640
|
),
|
|
2579
2641
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
|
|
2580
|
-
] }) }, moreInfo.title + index)) })
|
|
2642
|
+
] }) }, moreInfo.title + index)) }),
|
|
2643
|
+
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2645
|
+
"svg",
|
|
2646
|
+
{
|
|
2647
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2648
|
+
width: "12",
|
|
2649
|
+
height: "10",
|
|
2650
|
+
viewBox: "0 0 12 10",
|
|
2651
|
+
fill: "none",
|
|
2652
|
+
"aria-hidden": "true",
|
|
2653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2654
|
+
"path",
|
|
2655
|
+
{
|
|
2656
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
2657
|
+
fill: "#ffffff"
|
|
2658
|
+
}
|
|
2659
|
+
)
|
|
2660
|
+
}
|
|
2661
|
+
),
|
|
2662
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "pts-moreinfo-link-text", children: data.linksForMoreInfo[0].title })
|
|
2663
|
+
] })
|
|
2581
2664
|
] });
|
|
2582
2665
|
};
|
|
2583
2666
|
var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
|
|
@@ -2679,6 +2762,24 @@ var ValidationErrorSummaryList = ({
|
|
|
2679
2762
|
}) => {
|
|
2680
2763
|
console.log(formQuestions);
|
|
2681
2764
|
console.log(validationErrorsList);
|
|
2765
|
+
function filterIdsByGroupCheck(ids, questions) {
|
|
2766
|
+
var _a;
|
|
2767
|
+
const tailIds = /* @__PURE__ */ new Set();
|
|
2768
|
+
for (const q of questions) {
|
|
2769
|
+
const rules = (_a = q.validationType) != null ? _a : [];
|
|
2770
|
+
for (const rule of rules) {
|
|
2771
|
+
const m = /^groupCheck-(\d+(?:-\d+)*)$/.exec(rule.trim());
|
|
2772
|
+
if (!m) continue;
|
|
2773
|
+
const nums = m[1].split("-").map((s) => Number(s)).filter((n) => Number.isFinite(n));
|
|
2774
|
+
if (nums.length > 1) {
|
|
2775
|
+
for (let i = 1; i < nums.length; i++) {
|
|
2776
|
+
tailIds.add(nums[i]);
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
return ids.filter((id) => !tailIds.has(id));
|
|
2782
|
+
}
|
|
2682
2783
|
function scrollToQuestion(questionId) {
|
|
2683
2784
|
const container = document.getElementById(`question-${questionId}`);
|
|
2684
2785
|
if (container) {
|
|
@@ -2692,35 +2793,31 @@ var ValidationErrorSummaryList = ({
|
|
|
2692
2793
|
}
|
|
2693
2794
|
}
|
|
2694
2795
|
if (!validationErrorsList.length) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, {});
|
|
2695
|
-
const
|
|
2796
|
+
const filteredIds = filterIdsByGroupCheck(validationErrorsList, formQuestions);
|
|
2797
|
+
const count = filteredIds.length;
|
|
2696
2798
|
const title = summaryText.replace("{count}", count.toString()).replace("{plural}", count === 1 ? "sak" : "saker");
|
|
2697
2799
|
function getQuestionLabelById(id) {
|
|
2698
2800
|
const found = formQuestions.find((item) => item.id === id);
|
|
2699
2801
|
return found == null ? void 0 : found.questionLabel;
|
|
2700
2802
|
}
|
|
2701
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2702
|
-
"
|
|
2703
|
-
{
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
) }, questionId || i)) })
|
|
2720
|
-
] })
|
|
2721
|
-
]
|
|
2722
|
-
}
|
|
2723
|
-
);
|
|
2803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "pts-errorSummary-container pts-root-error", children: [
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { children: title }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("ul", { children: filteredIds.map((questionId, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2808
|
+
"a",
|
|
2809
|
+
{
|
|
2810
|
+
href: `#question-${questionId}`,
|
|
2811
|
+
onClick: (e) => {
|
|
2812
|
+
e.preventDefault();
|
|
2813
|
+
scrollToQuestion(questionId);
|
|
2814
|
+
},
|
|
2815
|
+
className: "errorSummary-text",
|
|
2816
|
+
children: getQuestionLabelById(questionId)
|
|
2817
|
+
}
|
|
2818
|
+
) }, questionId || i)) })
|
|
2819
|
+
] })
|
|
2820
|
+
] });
|
|
2724
2821
|
};
|
|
2725
2822
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
2726
2823
|
|
|
@@ -2760,7 +2857,7 @@ var CookieBanner = ({
|
|
|
2760
2857
|
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "content", children: [
|
|
2761
2858
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
|
|
2762
2859
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
|
|
2763
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", {
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "pts-cookieBanner-Links", children: [
|
|
2764
2861
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2765
2862
|
"svg",
|
|
2766
2863
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -54,10 +54,17 @@ var RadioMultipleStandard_default = InputRadio;
|
|
|
54
54
|
var PreviewRadio = ({ question }) => {
|
|
55
55
|
var _a, _b;
|
|
56
56
|
const previewId = `preview-${question.id}`;
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */ jsx("
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
59
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx(
|
|
60
|
+
"dd",
|
|
61
|
+
{
|
|
62
|
+
className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
|
|
63
|
+
id: `answer-${previewId}`,
|
|
64
|
+
children: "Inget svar"
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] });
|
|
61
68
|
};
|
|
62
69
|
|
|
63
70
|
// src/NewInputComponentStandard/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
@@ -94,7 +101,7 @@ var MultipleCheckboxes = ({
|
|
|
94
101
|
};
|
|
95
102
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
96
103
|
!showPreview && question.visible && /* @__PURE__ */ jsx2("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs2("section", { role: "group", "aria-labelledby": `label-${questionId}`, children: [
|
|
97
|
-
/* @__PURE__ */ jsxs2("
|
|
104
|
+
/* @__PURE__ */ jsxs2("h3", { id: `label-${questionId}`, children: [
|
|
98
105
|
question.questionLabel,
|
|
99
106
|
" ",
|
|
100
107
|
question.isQuestionMandatory && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
@@ -129,20 +136,14 @@ var PrevieMultipleCheckboxes = ({
|
|
|
129
136
|
}) => {
|
|
130
137
|
var _a, _b;
|
|
131
138
|
const previewId = `preview-${question.id}`;
|
|
132
|
-
return /* @__PURE__ */
|
|
133
|
-
"
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
var _a2;
|
|
141
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
142
|
-
}).map((option, index) => /* @__PURE__ */ jsx2("li", { children: option.label }, index)) }) : /* @__PURE__ */ jsx2("span", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }) })
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
) });
|
|
139
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
140
|
+
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
141
|
+
question.answer ? /* @__PURE__ */ jsx2(Fragment2, { children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
142
|
+
var _a2;
|
|
143
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
144
|
+
}).map((option, index) => /* @__PURE__ */ jsx2("dd", { children: option.label }, index)) }) : /* @__PURE__ */ jsx2("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
145
|
+
" "
|
|
146
|
+
] });
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
// src/NewInputComponentStandard/TextAreaStandard/TextAreaStandard.tsx
|
|
@@ -192,7 +193,7 @@ var InputTextarea = ({
|
|
|
192
193
|
"aria-required": question.isQuestionMandatory,
|
|
193
194
|
"aria-invalid": question.hasValidationError,
|
|
194
195
|
maxLength: ((_a = question.questionExtraAttribute) == null ? void 0 : _a.answerMaxLength) || defaultMaxLength,
|
|
195
|
-
"aria-describedby":
|
|
196
|
+
"aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
|
|
196
197
|
id: inputId
|
|
197
198
|
}
|
|
198
199
|
),
|
|
@@ -228,10 +229,17 @@ var PreviewTextarea = ({
|
|
|
228
229
|
}) => {
|
|
229
230
|
var _a, _b;
|
|
230
231
|
const previewId = `preview-${question.id}`;
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */ jsx3("
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
233
|
+
/* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
234
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx3("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx3(
|
|
235
|
+
"dd",
|
|
236
|
+
{
|
|
237
|
+
className: "pts-textArea-preview pts-root-answer no-answer-preview-page",
|
|
238
|
+
id: `answer-${previewId}`,
|
|
239
|
+
children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] });
|
|
235
243
|
};
|
|
236
244
|
|
|
237
245
|
// src/NewInputComponentStandard/TextFieldStandard/TextFieldStandard.tsx
|
|
@@ -285,7 +293,7 @@ var TextFieldStandard = ({
|
|
|
285
293
|
disabled: (_g = question.questionExtraAttribute) == null ? void 0 : _g.disabled,
|
|
286
294
|
required: question.isQuestionMandatory,
|
|
287
295
|
"aria-required": question.isQuestionMandatory,
|
|
288
|
-
"aria-describedby":
|
|
296
|
+
"aria-describedby": [question.aboutText ? aboutId : null, question.hasValidationError ? errorId : null].filter(Boolean).join(" ") || void 0,
|
|
289
297
|
"aria-invalid": question.hasValidationError,
|
|
290
298
|
"aria-errormessage": question.hasValidationError ? errorId : void 0
|
|
291
299
|
}
|
|
@@ -307,10 +315,17 @@ var PreviewTextField = ({
|
|
|
307
315
|
}) => {
|
|
308
316
|
var _a, _b;
|
|
309
317
|
const previewId = `preview-${question.id}`;
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */ jsx4("
|
|
312
|
-
|
|
313
|
-
|
|
318
|
+
return /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
319
|
+
/* @__PURE__ */ jsx4("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
320
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx4("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx4(
|
|
321
|
+
"dd",
|
|
322
|
+
{
|
|
323
|
+
className: "pts-textField-preview pts-root-answer no-answer-preview-page",
|
|
324
|
+
id: `answer-${previewId}`,
|
|
325
|
+
children: activatedLanguage === "en" ? "No Answer" : "Inget svar"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] });
|
|
314
329
|
};
|
|
315
330
|
|
|
316
331
|
// src/NewInputComponentStandard/FilesUploadStandard/FilesUploadStandard.tsx
|
|
@@ -1771,30 +1786,40 @@ var EditPreviewLink = ({
|
|
|
1771
1786
|
changeStepHandler,
|
|
1772
1787
|
activatedLanguage = "sv"
|
|
1773
1788
|
}) => {
|
|
1774
|
-
return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13(
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
children: /* @__PURE__ */ jsx14(
|
|
1786
|
-
"path",
|
|
1789
|
+
return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13(
|
|
1790
|
+
"a",
|
|
1791
|
+
{
|
|
1792
|
+
href: "#",
|
|
1793
|
+
onClick: (e) => {
|
|
1794
|
+
e.preventDefault();
|
|
1795
|
+
changeStepHandler(step);
|
|
1796
|
+
},
|
|
1797
|
+
children: [
|
|
1798
|
+
/* @__PURE__ */ jsx14(
|
|
1799
|
+
"svg",
|
|
1787
1800
|
{
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1801
|
+
"aria-hidden": "true",
|
|
1802
|
+
focusable: "false",
|
|
1803
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1804
|
+
width: "16",
|
|
1805
|
+
height: "16",
|
|
1806
|
+
viewBox: "0 0 16 16",
|
|
1807
|
+
fill: "none",
|
|
1808
|
+
children: /* @__PURE__ */ jsx14(
|
|
1809
|
+
"path",
|
|
1810
|
+
{
|
|
1811
|
+
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",
|
|
1812
|
+
stroke: "#6E3282",
|
|
1813
|
+
strokeLinecap: "round",
|
|
1814
|
+
strokeLinejoin: "round"
|
|
1815
|
+
}
|
|
1816
|
+
)
|
|
1792
1817
|
}
|
|
1793
|
-
)
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1818
|
+
),
|
|
1819
|
+
activatedLanguage === "en" ? `Edit step ${step.step}` : `Redigera steg ${step.step}`
|
|
1820
|
+
]
|
|
1821
|
+
}
|
|
1822
|
+
) });
|
|
1798
1823
|
};
|
|
1799
1824
|
var EditPreviewLinkStandard_default = EditPreviewLink;
|
|
1800
1825
|
|
|
@@ -1832,7 +1857,7 @@ var Footer = ({ activatedLanguage = "sv" }) => {
|
|
|
1832
1857
|
}
|
|
1833
1858
|
),
|
|
1834
1859
|
/* @__PURE__ */ jsx15(
|
|
1835
|
-
"
|
|
1860
|
+
"nav",
|
|
1836
1861
|
{
|
|
1837
1862
|
className: "pts-footer-linkList",
|
|
1838
1863
|
"aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
|
|
@@ -2394,40 +2419,77 @@ import { createElement } from "react";
|
|
|
2394
2419
|
import DOMPurify5 from "dompurify";
|
|
2395
2420
|
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2396
2421
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
2397
|
-
return /* @__PURE__ */ jsxs19(
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
"
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
"
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
viewBox: "0 0 12 10",
|
|
2416
|
-
fill: "none",
|
|
2417
|
-
children: /* @__PURE__ */ jsx20(
|
|
2418
|
-
"path",
|
|
2422
|
+
return /* @__PURE__ */ jsxs19(
|
|
2423
|
+
"section",
|
|
2424
|
+
{
|
|
2425
|
+
className: "pts-textHeadlineAndBody-container",
|
|
2426
|
+
"aria-labelledby": "textHeadlineAndBody-headline",
|
|
2427
|
+
children: [
|
|
2428
|
+
data.headline && createElement(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
|
|
2429
|
+
data.body && /* @__PURE__ */ jsx20("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
|
|
2430
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx20("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx20("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs19(
|
|
2431
|
+
"a",
|
|
2432
|
+
{
|
|
2433
|
+
href: link.url,
|
|
2434
|
+
target: "_blank",
|
|
2435
|
+
rel: "noopener noreferrer",
|
|
2436
|
+
"aria-label": link.ariaLabel,
|
|
2437
|
+
children: [
|
|
2438
|
+
/* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
|
|
2439
|
+
"svg",
|
|
2419
2440
|
{
|
|
2420
|
-
|
|
2421
|
-
|
|
2441
|
+
"aria-hidden": "true",
|
|
2442
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2443
|
+
width: "12",
|
|
2444
|
+
height: "10",
|
|
2445
|
+
viewBox: "0 0 12 10",
|
|
2446
|
+
fill: "none",
|
|
2447
|
+
children: /* @__PURE__ */ jsx20(
|
|
2448
|
+
"path",
|
|
2449
|
+
{
|
|
2450
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
2451
|
+
fill: "#ffffff"
|
|
2452
|
+
}
|
|
2453
|
+
)
|
|
2422
2454
|
}
|
|
2423
|
-
)
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2455
|
+
) }),
|
|
2456
|
+
link.title
|
|
2457
|
+
]
|
|
2458
|
+
}
|
|
2459
|
+
) }, `more-info-${index}`)) }),
|
|
2460
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs19(
|
|
2461
|
+
"a",
|
|
2462
|
+
{
|
|
2463
|
+
href: data.linksForMoreInfo[0].url,
|
|
2464
|
+
target: "_blank",
|
|
2465
|
+
rel: "noopener noreferrer",
|
|
2466
|
+
"aria-label": data.linksForMoreInfo[0].ariaLabel,
|
|
2467
|
+
children: [
|
|
2468
|
+
/* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
|
|
2469
|
+
"svg",
|
|
2470
|
+
{
|
|
2471
|
+
"aria-hidden": "true",
|
|
2472
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2473
|
+
width: "12",
|
|
2474
|
+
height: "10",
|
|
2475
|
+
viewBox: "0 0 12 10",
|
|
2476
|
+
fill: "none",
|
|
2477
|
+
children: /* @__PURE__ */ jsx20(
|
|
2478
|
+
"path",
|
|
2479
|
+
{
|
|
2480
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
2481
|
+
fill: "#ffffff"
|
|
2482
|
+
}
|
|
2483
|
+
)
|
|
2484
|
+
}
|
|
2485
|
+
) }),
|
|
2486
|
+
data.linksForMoreInfo[0].title
|
|
2487
|
+
]
|
|
2488
|
+
}
|
|
2489
|
+
)
|
|
2490
|
+
]
|
|
2491
|
+
}
|
|
2492
|
+
);
|
|
2431
2493
|
};
|
|
2432
2494
|
var TextHeadlineAndBodyStandard_default = TextHeadlineAndBody;
|
|
2433
2495
|
|
|
@@ -2492,7 +2554,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
|
2492
2554
|
return /* @__PURE__ */ jsxs20("div", { className: "pts-serviceHeadlineAndBody-container", children: [
|
|
2493
2555
|
data.mainHeadline && /* @__PURE__ */ jsx22("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
|
|
2494
2556
|
activeStep === 1 && data.ingressBody && /* @__PURE__ */ jsx22("div", { dangerouslySetInnerHTML: { __html: DOMPurify6.sanitize(data.ingressBody) } }),
|
|
2495
|
-
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length >
|
|
2557
|
+
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx22("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ jsx22("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs20("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
2496
2558
|
/* @__PURE__ */ jsx22(
|
|
2497
2559
|
"svg",
|
|
2498
2560
|
{
|
|
@@ -2512,7 +2574,28 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
|
2512
2574
|
}
|
|
2513
2575
|
),
|
|
2514
2576
|
/* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
|
|
2515
|
-
] }) }, moreInfo.title + index)) })
|
|
2577
|
+
] }) }, moreInfo.title + index)) }),
|
|
2578
|
+
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs20("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
2579
|
+
/* @__PURE__ */ jsx22(
|
|
2580
|
+
"svg",
|
|
2581
|
+
{
|
|
2582
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2583
|
+
width: "12",
|
|
2584
|
+
height: "10",
|
|
2585
|
+
viewBox: "0 0 12 10",
|
|
2586
|
+
fill: "none",
|
|
2587
|
+
"aria-hidden": "true",
|
|
2588
|
+
children: /* @__PURE__ */ jsx22(
|
|
2589
|
+
"path",
|
|
2590
|
+
{
|
|
2591
|
+
d: "M6.00001 9.63253L5.10321 8.82184L8.62749 5.57905H0.965332V4.42091H8.62749L5.10321 1.17813L6.00001 0.367432L11.0347 4.99998L6.00001 9.63253Z",
|
|
2592
|
+
fill: "#ffffff"
|
|
2593
|
+
}
|
|
2594
|
+
)
|
|
2595
|
+
}
|
|
2596
|
+
),
|
|
2597
|
+
/* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: data.linksForMoreInfo[0].title })
|
|
2598
|
+
] })
|
|
2516
2599
|
] });
|
|
2517
2600
|
};
|
|
2518
2601
|
var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
|
|
@@ -2614,6 +2697,24 @@ var ValidationErrorSummaryList = ({
|
|
|
2614
2697
|
}) => {
|
|
2615
2698
|
console.log(formQuestions);
|
|
2616
2699
|
console.log(validationErrorsList);
|
|
2700
|
+
function filterIdsByGroupCheck(ids, questions) {
|
|
2701
|
+
var _a;
|
|
2702
|
+
const tailIds = /* @__PURE__ */ new Set();
|
|
2703
|
+
for (const q of questions) {
|
|
2704
|
+
const rules = (_a = q.validationType) != null ? _a : [];
|
|
2705
|
+
for (const rule of rules) {
|
|
2706
|
+
const m = /^groupCheck-(\d+(?:-\d+)*)$/.exec(rule.trim());
|
|
2707
|
+
if (!m) continue;
|
|
2708
|
+
const nums = m[1].split("-").map((s) => Number(s)).filter((n) => Number.isFinite(n));
|
|
2709
|
+
if (nums.length > 1) {
|
|
2710
|
+
for (let i = 1; i < nums.length; i++) {
|
|
2711
|
+
tailIds.add(nums[i]);
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
return ids.filter((id) => !tailIds.has(id));
|
|
2717
|
+
}
|
|
2617
2718
|
function scrollToQuestion(questionId) {
|
|
2618
2719
|
const container = document.getElementById(`question-${questionId}`);
|
|
2619
2720
|
if (container) {
|
|
@@ -2627,35 +2728,31 @@ var ValidationErrorSummaryList = ({
|
|
|
2627
2728
|
}
|
|
2628
2729
|
}
|
|
2629
2730
|
if (!validationErrorsList.length) return /* @__PURE__ */ jsx26(Fragment15, {});
|
|
2630
|
-
const
|
|
2731
|
+
const filteredIds = filterIdsByGroupCheck(validationErrorsList, formQuestions);
|
|
2732
|
+
const count = filteredIds.length;
|
|
2631
2733
|
const title = summaryText.replace("{count}", count.toString()).replace("{plural}", count === 1 ? "sak" : "saker");
|
|
2632
2734
|
function getQuestionLabelById(id) {
|
|
2633
2735
|
const found = formQuestions.find((item) => item.id === id);
|
|
2634
2736
|
return found == null ? void 0 : found.questionLabel;
|
|
2635
2737
|
}
|
|
2636
|
-
return /* @__PURE__ */ jsxs23(
|
|
2637
|
-
"
|
|
2638
|
-
{
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
) }, questionId || i)) })
|
|
2655
|
-
] })
|
|
2656
|
-
]
|
|
2657
|
-
}
|
|
2658
|
-
);
|
|
2738
|
+
return /* @__PURE__ */ jsxs23("div", { className: "pts-errorSummary-container pts-root-error", children: [
|
|
2739
|
+
/* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
2740
|
+
/* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
|
|
2741
|
+
/* @__PURE__ */ jsx26("h2", { children: title }),
|
|
2742
|
+
/* @__PURE__ */ jsx26("ul", { children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
|
|
2743
|
+
"a",
|
|
2744
|
+
{
|
|
2745
|
+
href: `#question-${questionId}`,
|
|
2746
|
+
onClick: (e) => {
|
|
2747
|
+
e.preventDefault();
|
|
2748
|
+
scrollToQuestion(questionId);
|
|
2749
|
+
},
|
|
2750
|
+
className: "errorSummary-text",
|
|
2751
|
+
children: getQuestionLabelById(questionId)
|
|
2752
|
+
}
|
|
2753
|
+
) }, questionId || i)) })
|
|
2754
|
+
] })
|
|
2755
|
+
] });
|
|
2659
2756
|
};
|
|
2660
2757
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
2661
2758
|
|
|
@@ -2695,7 +2792,7 @@ var CookieBanner = ({
|
|
|
2695
2792
|
children: /* @__PURE__ */ jsxs24("div", { className: "content", children: [
|
|
2696
2793
|
/* @__PURE__ */ jsx27("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
|
|
2697
2794
|
/* @__PURE__ */ jsx27("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
|
|
2698
|
-
/* @__PURE__ */ jsxs24("div", {
|
|
2795
|
+
/* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Links", children: [
|
|
2699
2796
|
/* @__PURE__ */ jsxs24(
|
|
2700
2797
|
"svg",
|
|
2701
2798
|
{
|
package/package.json
CHANGED