optimized-react-component-library-xyz123 0.28.2 → 0.28.3
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 +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +46 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -9
package/dist/index.d.mts
CHANGED
|
@@ -113,11 +113,22 @@ interface IStepQuestionData {
|
|
|
113
113
|
}[];
|
|
114
114
|
}[];
|
|
115
115
|
}
|
|
116
|
+
interface IAppSettingsCookies {
|
|
117
|
+
useCookies: boolean;
|
|
118
|
+
cookieName: string;
|
|
119
|
+
cookieChoiseKey: string;
|
|
120
|
+
}
|
|
121
|
+
interface IAppSettings {
|
|
122
|
+
appUsesLanguage: boolean;
|
|
123
|
+
appUsesNavigation: boolean;
|
|
124
|
+
appCookies?: IAppSettingsCookies;
|
|
125
|
+
}
|
|
116
126
|
|
|
117
127
|
interface RadioProps {
|
|
118
128
|
question: IQuestion;
|
|
119
129
|
handleQuestionInputChange: any;
|
|
120
130
|
showPreview?: boolean;
|
|
131
|
+
activatedLanguage?: string;
|
|
121
132
|
}
|
|
122
133
|
|
|
123
134
|
declare const InputRadio: FC<RadioProps>;
|
|
@@ -727,6 +738,7 @@ interface CookieBannerProps {
|
|
|
727
738
|
onClose?: () => void;
|
|
728
739
|
acceptCookies: () => void;
|
|
729
740
|
rejectCookies: () => void;
|
|
741
|
+
activatedLanguage?: string;
|
|
730
742
|
}
|
|
731
743
|
|
|
732
744
|
declare const CookieBanner: React$1.FC<CookieBannerProps>;
|
|
@@ -752,7 +764,10 @@ interface ModalProps {
|
|
|
752
764
|
|
|
753
765
|
declare const Modal: FC<ModalProps>;
|
|
754
766
|
|
|
755
|
-
|
|
767
|
+
type SkipLinkProps = {
|
|
768
|
+
activatedLanguage?: string;
|
|
769
|
+
};
|
|
770
|
+
declare const SkipLink: FC<SkipLinkProps>;
|
|
756
771
|
|
|
757
772
|
interface PrincipleOfPublicityProps {
|
|
758
773
|
activatedLanguage?: string;
|
|
@@ -778,6 +793,7 @@ interface StartApplicationButtonProps {
|
|
|
778
793
|
onClick: (event: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
779
794
|
label?: string;
|
|
780
795
|
className?: string;
|
|
796
|
+
activatedLanguage?: string;
|
|
781
797
|
}
|
|
782
798
|
/**
|
|
783
799
|
* En standardiserad knapp för att starta e-tjänsten.
|
|
@@ -785,6 +801,7 @@ interface StartApplicationButtonProps {
|
|
|
785
801
|
* @param {Function} onClick - Funktion som körs när användaren klickar på knappen.
|
|
786
802
|
* @param {string} label - Text som visas på knappen.
|
|
787
803
|
* @param {string} className - Extra CSS-klasser för knappen.
|
|
804
|
+
* @param {string} activatedLanguage - Aktiverat språk.
|
|
788
805
|
*/
|
|
789
806
|
declare const StartApplicationButton: React$1.FC<StartApplicationButtonProps>;
|
|
790
807
|
|
|
@@ -845,14 +862,16 @@ declare const ValidationErrorSummaryList: React$1.FC<ValidationErrorSummaryListP
|
|
|
845
862
|
|
|
846
863
|
interface FormStatusMessagesProps {
|
|
847
864
|
formStatus: string;
|
|
865
|
+
activatedLanguage?: string;
|
|
848
866
|
}
|
|
849
867
|
/**
|
|
850
868
|
* Visar ett error-meddelande om formuläret misslyckas att skicka in, dvs. status är
|
|
851
869
|
* failed. Läser upp att formuläret laddas för skärmläsare när status är loading.
|
|
852
870
|
*
|
|
853
871
|
* @param {string} formStatus Nuvarande status för formuläret.
|
|
872
|
+
* @param {string} [activatedLanguage='sv'] Den aktiverade språkkoden (default är svenska).
|
|
854
873
|
*
|
|
855
874
|
*/
|
|
856
875
|
declare const FormStatusMessagesScreenReader: React$1.FC<FormStatusMessagesProps>;
|
|
857
876
|
|
|
858
|
-
export { AddFiles as AddFilesStandard, CheckboxGroup as CheckboxGroupStandard, CookieBanner, type CookieConsentConfig, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
|
877
|
+
export { AddFiles as AddFilesStandard, CheckboxGroup as CheckboxGroupStandard, CookieBanner, type CookieConsentConfig, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IAppSettings, type IAppSettingsCookies, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
package/dist/index.d.ts
CHANGED
|
@@ -113,11 +113,22 @@ interface IStepQuestionData {
|
|
|
113
113
|
}[];
|
|
114
114
|
}[];
|
|
115
115
|
}
|
|
116
|
+
interface IAppSettingsCookies {
|
|
117
|
+
useCookies: boolean;
|
|
118
|
+
cookieName: string;
|
|
119
|
+
cookieChoiseKey: string;
|
|
120
|
+
}
|
|
121
|
+
interface IAppSettings {
|
|
122
|
+
appUsesLanguage: boolean;
|
|
123
|
+
appUsesNavigation: boolean;
|
|
124
|
+
appCookies?: IAppSettingsCookies;
|
|
125
|
+
}
|
|
116
126
|
|
|
117
127
|
interface RadioProps {
|
|
118
128
|
question: IQuestion;
|
|
119
129
|
handleQuestionInputChange: any;
|
|
120
130
|
showPreview?: boolean;
|
|
131
|
+
activatedLanguage?: string;
|
|
121
132
|
}
|
|
122
133
|
|
|
123
134
|
declare const InputRadio: FC<RadioProps>;
|
|
@@ -727,6 +738,7 @@ interface CookieBannerProps {
|
|
|
727
738
|
onClose?: () => void;
|
|
728
739
|
acceptCookies: () => void;
|
|
729
740
|
rejectCookies: () => void;
|
|
741
|
+
activatedLanguage?: string;
|
|
730
742
|
}
|
|
731
743
|
|
|
732
744
|
declare const CookieBanner: React$1.FC<CookieBannerProps>;
|
|
@@ -752,7 +764,10 @@ interface ModalProps {
|
|
|
752
764
|
|
|
753
765
|
declare const Modal: FC<ModalProps>;
|
|
754
766
|
|
|
755
|
-
|
|
767
|
+
type SkipLinkProps = {
|
|
768
|
+
activatedLanguage?: string;
|
|
769
|
+
};
|
|
770
|
+
declare const SkipLink: FC<SkipLinkProps>;
|
|
756
771
|
|
|
757
772
|
interface PrincipleOfPublicityProps {
|
|
758
773
|
activatedLanguage?: string;
|
|
@@ -778,6 +793,7 @@ interface StartApplicationButtonProps {
|
|
|
778
793
|
onClick: (event: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
779
794
|
label?: string;
|
|
780
795
|
className?: string;
|
|
796
|
+
activatedLanguage?: string;
|
|
781
797
|
}
|
|
782
798
|
/**
|
|
783
799
|
* En standardiserad knapp för att starta e-tjänsten.
|
|
@@ -785,6 +801,7 @@ interface StartApplicationButtonProps {
|
|
|
785
801
|
* @param {Function} onClick - Funktion som körs när användaren klickar på knappen.
|
|
786
802
|
* @param {string} label - Text som visas på knappen.
|
|
787
803
|
* @param {string} className - Extra CSS-klasser för knappen.
|
|
804
|
+
* @param {string} activatedLanguage - Aktiverat språk.
|
|
788
805
|
*/
|
|
789
806
|
declare const StartApplicationButton: React$1.FC<StartApplicationButtonProps>;
|
|
790
807
|
|
|
@@ -845,14 +862,16 @@ declare const ValidationErrorSummaryList: React$1.FC<ValidationErrorSummaryListP
|
|
|
845
862
|
|
|
846
863
|
interface FormStatusMessagesProps {
|
|
847
864
|
formStatus: string;
|
|
865
|
+
activatedLanguage?: string;
|
|
848
866
|
}
|
|
849
867
|
/**
|
|
850
868
|
* Visar ett error-meddelande om formuläret misslyckas att skicka in, dvs. status är
|
|
851
869
|
* failed. Läser upp att formuläret laddas för skärmläsare när status är loading.
|
|
852
870
|
*
|
|
853
871
|
* @param {string} formStatus Nuvarande status för formuläret.
|
|
872
|
+
* @param {string} [activatedLanguage='sv'] Den aktiverade språkkoden (default är svenska).
|
|
854
873
|
*
|
|
855
874
|
*/
|
|
856
875
|
declare const FormStatusMessagesScreenReader: React$1.FC<FormStatusMessagesProps>;
|
|
857
876
|
|
|
858
|
-
export { AddFiles as AddFilesStandard, CheckboxGroup as CheckboxGroupStandard, CookieBanner, type CookieConsentConfig, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
|
877
|
+
export { AddFiles as AddFilesStandard, CheckboxGroup as CheckboxGroupStandard, CookieBanner, type CookieConsentConfig, EditPreviewLink as EditPreviewLinkStandard, Footer as FooterStandard, FormStatusMessagesScreenReader, Header as HeaderStandard, type IAppSettings, type IAppSettingsCookies, type IApplicationContent, type IFormState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createFormSlice, createGlobalLanguageSlice, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeFormSelectors, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, makeglobalLanguageSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
package/dist/index.js
CHANGED
|
@@ -85,7 +85,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
85
85
|
var InputRadio = ({
|
|
86
86
|
question,
|
|
87
87
|
handleQuestionInputChange,
|
|
88
|
-
showPreview = false
|
|
88
|
+
showPreview = false,
|
|
89
|
+
activatedLanguage = "sv"
|
|
89
90
|
}) => {
|
|
90
91
|
var _a;
|
|
91
92
|
const questionId = `question-${question.id}`;
|
|
@@ -131,11 +132,11 @@ var InputRadio = ({
|
|
|
131
132
|
]
|
|
132
133
|
}
|
|
133
134
|
) }),
|
|
134
|
-
showPreview && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewRadio, { question })
|
|
135
|
+
showPreview && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreviewRadio, { question, activatedLanguage })
|
|
135
136
|
] });
|
|
136
137
|
};
|
|
137
138
|
var RadioMultipleStandard_default = InputRadio;
|
|
138
|
-
var PreviewRadio = ({ question }) => {
|
|
139
|
+
var PreviewRadio = ({ question, activatedLanguage }) => {
|
|
139
140
|
var _a, _b;
|
|
140
141
|
const previewId = `preview-${question.id}`;
|
|
141
142
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -145,7 +146,7 @@ var PreviewRadio = ({ question }) => {
|
|
|
145
146
|
{
|
|
146
147
|
className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
|
|
147
148
|
id: `answer-${previewId}`,
|
|
148
|
-
children: "Inget svar"
|
|
149
|
+
children: activatedLanguage === "en" ? "No answer" : "Inget svar"
|
|
149
150
|
}
|
|
150
151
|
)
|
|
151
152
|
] });
|
|
@@ -167,17 +168,17 @@ var MultipleCheckboxes = ({
|
|
|
167
168
|
var _a2;
|
|
168
169
|
const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
|
|
169
170
|
var _a3;
|
|
170
|
-
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.
|
|
171
|
-
}).map((option) => option.
|
|
171
|
+
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.id);
|
|
172
|
+
}).map((option) => option.id)) || [];
|
|
172
173
|
console.log("Initial values:", initialValues);
|
|
173
174
|
setCheckedValues(initialValues);
|
|
174
175
|
}, [question.answer, question.options]);
|
|
175
|
-
const handleInputChange = (event,
|
|
176
|
+
const handleInputChange = (event, optionId) => {
|
|
176
177
|
let updatedValues = [...checkedValues];
|
|
177
|
-
if (updatedValues.includes(
|
|
178
|
-
updatedValues = updatedValues.filter((val) => val !==
|
|
178
|
+
if (updatedValues.includes(optionId)) {
|
|
179
|
+
updatedValues = updatedValues.filter((val) => val !== optionId);
|
|
179
180
|
} else {
|
|
180
|
-
updatedValues.push(
|
|
181
|
+
updatedValues.push(optionId);
|
|
181
182
|
}
|
|
182
183
|
setCheckedValues(updatedValues);
|
|
183
184
|
const e = { target: { value: updatedValues.toString() } };
|
|
@@ -199,9 +200,9 @@ var MultipleCheckboxes = ({
|
|
|
199
200
|
type: "checkbox",
|
|
200
201
|
name: `${question.id}-option`,
|
|
201
202
|
id: `${question.id}-option-${index}`,
|
|
202
|
-
value: option.
|
|
203
|
-
checked: checkedValues.includes(option.
|
|
204
|
-
onChange: (e) => handleInputChange(e, option.
|
|
203
|
+
value: option.id,
|
|
204
|
+
checked: checkedValues.includes(option.id),
|
|
205
|
+
onChange: (e) => handleInputChange(e, option.id),
|
|
205
206
|
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
206
207
|
}
|
|
207
208
|
),
|
|
@@ -223,7 +224,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
223
224
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
224
225
|
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: question.options[0].label }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
225
226
|
var _a2;
|
|
226
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.
|
|
227
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.id);
|
|
227
228
|
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
228
229
|
" "
|
|
229
230
|
] });
|
|
@@ -247,8 +248,8 @@ var CheckboxGroup = ({
|
|
|
247
248
|
var _a2;
|
|
248
249
|
const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
|
|
249
250
|
var _a3;
|
|
250
|
-
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.
|
|
251
|
-
}).map((option) => option.
|
|
251
|
+
return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.id);
|
|
252
|
+
}).map((option) => option.id)) || [];
|
|
252
253
|
setCheckedValues(initialValues);
|
|
253
254
|
}, [question.answer, question.options]);
|
|
254
255
|
const handleInputChange = (event, optionValue) => {
|
|
@@ -282,9 +283,9 @@ var CheckboxGroup = ({
|
|
|
282
283
|
type: "checkbox",
|
|
283
284
|
name: `name-${question.id}`,
|
|
284
285
|
id: `${groupId}-option-${index}`,
|
|
285
|
-
value: option.
|
|
286
|
-
checked: checkedValues.includes(option.
|
|
287
|
-
onChange: (e) => handleInputChange(e, option.
|
|
286
|
+
value: option.id,
|
|
287
|
+
checked: checkedValues.includes(option.id),
|
|
288
|
+
onChange: (e) => handleInputChange(e, option.id),
|
|
288
289
|
className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
|
|
289
290
|
}
|
|
290
291
|
),
|
|
@@ -312,7 +313,7 @@ var PreviewCheckboxGroup = ({
|
|
|
312
313
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
313
314
|
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) => {
|
|
314
315
|
var _a2;
|
|
315
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.
|
|
316
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.id);
|
|
316
317
|
}).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" }),
|
|
317
318
|
" "
|
|
318
319
|
] });
|
|
@@ -783,7 +784,7 @@ var SelectedFiles = ({
|
|
|
783
784
|
}
|
|
784
785
|
) })
|
|
785
786
|
] }) }),
|
|
786
|
-
questionObject.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
787
|
+
questionObject.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": activatedLanguage === "en" ? "Uploaded files" : "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
787
788
|
const indicatorfileName = file.FileName;
|
|
788
789
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
789
790
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
@@ -1278,7 +1279,7 @@ function createApiDataObject(data, specialMappedQuestions, translatedAnswers) {
|
|
|
1278
1279
|
let translatedAnswer = question.answer;
|
|
1279
1280
|
if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
|
|
1280
1281
|
const answerNormalized = normalize(question.answer);
|
|
1281
|
-
const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.
|
|
1282
|
+
const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.id))).map((option) => `^${option.id}^`);
|
|
1282
1283
|
if (matchingIds.length > 0) {
|
|
1283
1284
|
translatedAnswer = matchingIds.join(",");
|
|
1284
1285
|
}
|
|
@@ -2069,7 +2070,8 @@ var CookieBanner = ({
|
|
|
2069
2070
|
onCookieStateChange,
|
|
2070
2071
|
onClose,
|
|
2071
2072
|
acceptCookies,
|
|
2072
|
-
rejectCookies
|
|
2073
|
+
rejectCookies,
|
|
2074
|
+
activatedLanguage = "sv"
|
|
2073
2075
|
}) => {
|
|
2074
2076
|
if (!visible) return null;
|
|
2075
2077
|
const handleCookieChoice = (accepted) => {
|
|
@@ -2096,8 +2098,13 @@ var CookieBanner = ({
|
|
|
2096
2098
|
id: "cookie-banner",
|
|
2097
2099
|
tabIndex: -1,
|
|
2098
2100
|
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "content", children: [
|
|
2099
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
|
2100
|
-
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("h3", { id: "cookie-banner-title", children: [
|
|
2102
|
+
" ",
|
|
2103
|
+
activatedLanguage === "en" ? "Cookies" : "Kakor (cookies)"
|
|
2104
|
+
] }),
|
|
2105
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { id: "cookie-banner-description", children: activatedLanguage === "en" ? `PTS would like to use a web analytics cookie in order to continuously improve pts.se. Do you consent? You can change your choice at any time. To withdraw your consent, click on \u201CCookies\u201D at the bottom of the website.` : `PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen.
|
|
2106
|
+
Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt
|
|
2107
|
+
samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen.` }),
|
|
2101
2108
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "pts-cookieBanner-Links", children: [
|
|
2102
2109
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2103
2110
|
"svg",
|
|
@@ -2126,13 +2133,13 @@ var CookieBanner = ({
|
|
|
2126
2133
|
href: "https://pts.se/om-oss/om-pts.se/kakor-pa-webbplatsen/kakor-pa-pts-e-tjanster/",
|
|
2127
2134
|
target: "_blank",
|
|
2128
2135
|
rel: "noopener noreferrer",
|
|
2129
|
-
children: "Kakor (cookies) p\xE5 pts.se (\xF6ppnas i ny flik)"
|
|
2136
|
+
children: activatedLanguage === "en" ? "Cookies on pts.se (opens in new tab)" : "Kakor (cookies) p\xE5 pts.se (\xF6ppnas i ny flik)"
|
|
2130
2137
|
}
|
|
2131
2138
|
)
|
|
2132
2139
|
] }),
|
|
2133
2140
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
2134
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
2135
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => handleCookieChoice(true), children: activatedLanguage === "en" ? "Yes, I consent" : "Ja, jag samtycker" }),
|
|
2142
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => handleCookieChoice(false), children: activatedLanguage === "en" ? "No, I do not consent" : "Nej, jag samtycker inte" })
|
|
2136
2143
|
] })
|
|
2137
2144
|
] })
|
|
2138
2145
|
}
|
|
@@ -2680,9 +2687,9 @@ var ModalStandard_default = Modal;
|
|
|
2680
2687
|
|
|
2681
2688
|
// src/components/layout/SkipLinkStandard/SkipLinkStandard.tsx
|
|
2682
2689
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2683
|
-
var SkipLink = () => {
|
|
2690
|
+
var SkipLink = ({ activatedLanguage = "sv" }) => {
|
|
2684
2691
|
function scrollToMainContent() {
|
|
2685
|
-
const container = document.getElementById(`main-
|
|
2692
|
+
const container = document.getElementById(`pts-main-service-headline`);
|
|
2686
2693
|
if (container) {
|
|
2687
2694
|
container.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
2688
2695
|
container.focus();
|
|
@@ -2696,7 +2703,7 @@ var SkipLink = () => {
|
|
|
2696
2703
|
e.preventDefault();
|
|
2697
2704
|
scrollToMainContent();
|
|
2698
2705
|
},
|
|
2699
|
-
children: "Till huvudinneh\xE5ll"
|
|
2706
|
+
children: activatedLanguage === "en" ? "Skip to main content" : "Till huvudinneh\xE5ll"
|
|
2700
2707
|
}
|
|
2701
2708
|
) });
|
|
2702
2709
|
};
|
|
@@ -2928,16 +2935,18 @@ var EditPreviewLinkStandard_default = EditPreviewLink;
|
|
|
2928
2935
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2929
2936
|
var StartApplicationButton = ({
|
|
2930
2937
|
onClick,
|
|
2931
|
-
label
|
|
2932
|
-
className = ""
|
|
2938
|
+
label,
|
|
2939
|
+
className = "",
|
|
2940
|
+
activatedLanguage = "sv"
|
|
2933
2941
|
}) => {
|
|
2942
|
+
const defaultLabel = activatedLanguage === "en" ? "Start e-service" : "Starta e-tj\xE4nsten";
|
|
2934
2943
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2935
2944
|
"button",
|
|
2936
2945
|
{
|
|
2937
2946
|
type: "button",
|
|
2938
2947
|
className: `pts-forwardButton pts-start-applicationButton ${className}`,
|
|
2939
2948
|
onClick,
|
|
2940
|
-
children: label
|
|
2949
|
+
children: label || defaultLabel
|
|
2941
2950
|
}
|
|
2942
2951
|
);
|
|
2943
2952
|
};
|
|
@@ -3096,10 +3105,10 @@ var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
|
3096
3105
|
|
|
3097
3106
|
// src/components/validation-and-status/FormStatusMessagesScreenReader/FormStatusMessagesScreenReader.tsx
|
|
3098
3107
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3099
|
-
var FormStatusMessagesScreenReader = ({ formStatus }) => {
|
|
3108
|
+
var FormStatusMessagesScreenReader = ({ formStatus, activatedLanguage = "sv" }) => {
|
|
3100
3109
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
3101
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "pts-root-mandatoryAsterisk", children: "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3102
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
|
|
3110
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "pts-root-mandatoryAsterisk", children: activatedLanguage === "en" ? "Something went wrong, please try again later or contact us!" : "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? activatedLanguage === "en" ? "Your case is being registered. Please do not refresh or close the page." : "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
|
|
3103
3112
|
] });
|
|
3104
3113
|
};
|
|
3105
3114
|
var FormStatusMessagesScreenReader_default = FormStatusMessagesScreenReader;
|