optimized-react-component-library-xyz123 2.5.9 → 2.5.11
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 +45 -3
- package/dist/index.d.ts +45 -3
- package/dist/index.js +104 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/darkMode.css +63 -74
- package/src/css/questions.css +15 -18
package/dist/index.d.mts
CHANGED
|
@@ -147,6 +147,8 @@ interface IAppSettings {
|
|
|
147
147
|
appCookies?: IAppSettingsCookies;
|
|
148
148
|
appUsesPreview?: boolean;
|
|
149
149
|
appUsesAsterisk?: boolean;
|
|
150
|
+
appUsesResetButton?: boolean;
|
|
151
|
+
appUsesApi?: boolean;
|
|
150
152
|
}
|
|
151
153
|
type INavigationItem = {
|
|
152
154
|
label: {
|
|
@@ -233,14 +235,14 @@ interface InfoOnlyProps {
|
|
|
233
235
|
|
|
234
236
|
declare const InputInfoOnly: FC<InfoOnlyProps>;
|
|
235
237
|
|
|
236
|
-
interface
|
|
238
|
+
interface RadioMultipleWithInfo2Props {
|
|
237
239
|
question: IQuestion;
|
|
238
240
|
handleQuestionInputChange: any;
|
|
239
241
|
showPreview?: boolean;
|
|
240
242
|
activatedLanguage?: string;
|
|
241
243
|
}
|
|
242
244
|
|
|
243
|
-
declare const RadioWithInfo: FC<
|
|
245
|
+
declare const RadioWithInfo: FC<RadioMultipleWithInfo2Props>;
|
|
244
246
|
|
|
245
247
|
/**
|
|
246
248
|
* Kontrollerar om en fråga har ett valideringsfel baserat på dess egenskaper och valideringstyper.
|
|
@@ -365,6 +367,7 @@ interface LanguageEntry {
|
|
|
365
367
|
backButton: string;
|
|
366
368
|
forwardButton: string;
|
|
367
369
|
sendButton: string;
|
|
370
|
+
restartButton: string;
|
|
368
371
|
}
|
|
369
372
|
interface LanguageSupportConfig {
|
|
370
373
|
activatedLanguage: string;
|
|
@@ -377,6 +380,7 @@ interface LanguageState {
|
|
|
377
380
|
backButton: string;
|
|
378
381
|
forwardButton: string;
|
|
379
382
|
sendButton: string;
|
|
383
|
+
restartButton: string;
|
|
380
384
|
}
|
|
381
385
|
declare const createGlobalLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
382
386
|
name?: string;
|
|
@@ -395,6 +399,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
395
399
|
backButton: string;
|
|
396
400
|
forwardButton: string;
|
|
397
401
|
sendButton: string;
|
|
402
|
+
restartButton: string;
|
|
398
403
|
}) & {
|
|
399
404
|
clearCache: () => void;
|
|
400
405
|
resultsCount: () => number;
|
|
@@ -407,6 +412,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
407
412
|
backButton: string;
|
|
408
413
|
forwardButton: string;
|
|
409
414
|
sendButton: string;
|
|
415
|
+
restartButton: string;
|
|
410
416
|
};
|
|
411
417
|
memoizedResultFunc: ((resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
|
|
412
418
|
activatedLanguage: string;
|
|
@@ -415,6 +421,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
415
421
|
backButton: string;
|
|
416
422
|
forwardButton: string;
|
|
417
423
|
sendButton: string;
|
|
424
|
+
restartButton: string;
|
|
418
425
|
}) & {
|
|
419
426
|
clearCache: () => void;
|
|
420
427
|
resultsCount: () => number;
|
|
@@ -427,6 +434,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
427
434
|
backButton: string;
|
|
428
435
|
forwardButton: string;
|
|
429
436
|
sendButton: string;
|
|
437
|
+
restartButton: string;
|
|
430
438
|
};
|
|
431
439
|
dependencies: [(state: TState) => LanguageState, (_: TState, activatedLanguage: string) => string];
|
|
432
440
|
recomputations: () => number;
|
|
@@ -982,6 +990,40 @@ interface StepperProps {
|
|
|
982
990
|
|
|
983
991
|
declare const Stepper: FC<StepperProps>;
|
|
984
992
|
|
|
993
|
+
interface StepperButtonsNoApiProps {
|
|
994
|
+
globalLanguageState?: any;
|
|
995
|
+
changeStepHandler: (activeStep: number) => void;
|
|
996
|
+
nextStepButtonHandler?: (e: any) => void;
|
|
997
|
+
onSubmitHandler?: (e: any) => void;
|
|
998
|
+
steps?: any[];
|
|
999
|
+
activeStep: number;
|
|
1000
|
+
appUsesResetButton?: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Renderar navigationsknappar för steg-navigering i ett flerstegsformulär.
|
|
1005
|
+
*
|
|
1006
|
+
* Funktionalitet:
|
|
1007
|
+
* Visar en "Tillbaka"-knapp när activeStep > 0.
|
|
1008
|
+
* Visar "Nästa"-knappen fram tills sista steget.
|
|
1009
|
+
* Byter "Nästa"-knappen till "Skicka" vid sista steget.
|
|
1010
|
+
*
|
|
1011
|
+
* @param {Object} globalLanguageState Objekt med språksträngar för knapparna.
|
|
1012
|
+
* Förväntas innehålla: backButton, forwardButton, sendButton.
|
|
1013
|
+
*
|
|
1014
|
+
* @param {Function} changeStepHandler Callback när användaren går bakåt i stegen.
|
|
1015
|
+
*
|
|
1016
|
+
* @param {Function} nextStepButtonHandler Callback när användaren går till nästa steg.
|
|
1017
|
+
*
|
|
1018
|
+
* @param {Function} onSubmitHandler Callback när sista steget nås och formuläret ska skickas in.
|
|
1019
|
+
*
|
|
1020
|
+
* @param {Array} steps Lista över alla steg i formuläret.
|
|
1021
|
+
* Används för att räkna ut sista stegnumret.
|
|
1022
|
+
*
|
|
1023
|
+
* @param {number} activeStep Det aktuella steget i flerstegsformuläret.
|
|
1024
|
+
*/
|
|
1025
|
+
declare const StepperButtonsNoApi: FC<StepperButtonsNoApiProps>;
|
|
1026
|
+
|
|
985
1027
|
interface ValidationErrorSummaryListProps {
|
|
986
1028
|
questions: any[];
|
|
987
1029
|
activatedLanguage: string;
|
|
@@ -1011,4 +1053,4 @@ interface FormStatusMessagesProps {
|
|
|
1011
1053
|
*/
|
|
1012
1054
|
declare const FormStatusMessagesScreenReader: React$1.FC<FormStatusMessagesProps>;
|
|
1013
1055
|
|
|
1014
|
-
export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, 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, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as
|
|
1056
|
+
export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, 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, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as RadioMultipleWithInfo2Standard, SearchBar, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtonsNoApi as StepperButtonsNoApiStandard, 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
|
@@ -147,6 +147,8 @@ interface IAppSettings {
|
|
|
147
147
|
appCookies?: IAppSettingsCookies;
|
|
148
148
|
appUsesPreview?: boolean;
|
|
149
149
|
appUsesAsterisk?: boolean;
|
|
150
|
+
appUsesResetButton?: boolean;
|
|
151
|
+
appUsesApi?: boolean;
|
|
150
152
|
}
|
|
151
153
|
type INavigationItem = {
|
|
152
154
|
label: {
|
|
@@ -233,14 +235,14 @@ interface InfoOnlyProps {
|
|
|
233
235
|
|
|
234
236
|
declare const InputInfoOnly: FC<InfoOnlyProps>;
|
|
235
237
|
|
|
236
|
-
interface
|
|
238
|
+
interface RadioMultipleWithInfo2Props {
|
|
237
239
|
question: IQuestion;
|
|
238
240
|
handleQuestionInputChange: any;
|
|
239
241
|
showPreview?: boolean;
|
|
240
242
|
activatedLanguage?: string;
|
|
241
243
|
}
|
|
242
244
|
|
|
243
|
-
declare const RadioWithInfo: FC<
|
|
245
|
+
declare const RadioWithInfo: FC<RadioMultipleWithInfo2Props>;
|
|
244
246
|
|
|
245
247
|
/**
|
|
246
248
|
* Kontrollerar om en fråga har ett valideringsfel baserat på dess egenskaper och valideringstyper.
|
|
@@ -365,6 +367,7 @@ interface LanguageEntry {
|
|
|
365
367
|
backButton: string;
|
|
366
368
|
forwardButton: string;
|
|
367
369
|
sendButton: string;
|
|
370
|
+
restartButton: string;
|
|
368
371
|
}
|
|
369
372
|
interface LanguageSupportConfig {
|
|
370
373
|
activatedLanguage: string;
|
|
@@ -377,6 +380,7 @@ interface LanguageState {
|
|
|
377
380
|
backButton: string;
|
|
378
381
|
forwardButton: string;
|
|
379
382
|
sendButton: string;
|
|
383
|
+
restartButton: string;
|
|
380
384
|
}
|
|
381
385
|
declare const createGlobalLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
382
386
|
name?: string;
|
|
@@ -395,6 +399,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
395
399
|
backButton: string;
|
|
396
400
|
forwardButton: string;
|
|
397
401
|
sendButton: string;
|
|
402
|
+
restartButton: string;
|
|
398
403
|
}) & {
|
|
399
404
|
clearCache: () => void;
|
|
400
405
|
resultsCount: () => number;
|
|
@@ -407,6 +412,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
407
412
|
backButton: string;
|
|
408
413
|
forwardButton: string;
|
|
409
414
|
sendButton: string;
|
|
415
|
+
restartButton: string;
|
|
410
416
|
};
|
|
411
417
|
memoizedResultFunc: ((resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
|
|
412
418
|
activatedLanguage: string;
|
|
@@ -415,6 +421,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
415
421
|
backButton: string;
|
|
416
422
|
forwardButton: string;
|
|
417
423
|
sendButton: string;
|
|
424
|
+
restartButton: string;
|
|
418
425
|
}) & {
|
|
419
426
|
clearCache: () => void;
|
|
420
427
|
resultsCount: () => number;
|
|
@@ -427,6 +434,7 @@ declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState)
|
|
|
427
434
|
backButton: string;
|
|
428
435
|
forwardButton: string;
|
|
429
436
|
sendButton: string;
|
|
437
|
+
restartButton: string;
|
|
430
438
|
};
|
|
431
439
|
dependencies: [(state: TState) => LanguageState, (_: TState, activatedLanguage: string) => string];
|
|
432
440
|
recomputations: () => number;
|
|
@@ -982,6 +990,40 @@ interface StepperProps {
|
|
|
982
990
|
|
|
983
991
|
declare const Stepper: FC<StepperProps>;
|
|
984
992
|
|
|
993
|
+
interface StepperButtonsNoApiProps {
|
|
994
|
+
globalLanguageState?: any;
|
|
995
|
+
changeStepHandler: (activeStep: number) => void;
|
|
996
|
+
nextStepButtonHandler?: (e: any) => void;
|
|
997
|
+
onSubmitHandler?: (e: any) => void;
|
|
998
|
+
steps?: any[];
|
|
999
|
+
activeStep: number;
|
|
1000
|
+
appUsesResetButton?: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Renderar navigationsknappar för steg-navigering i ett flerstegsformulär.
|
|
1005
|
+
*
|
|
1006
|
+
* Funktionalitet:
|
|
1007
|
+
* Visar en "Tillbaka"-knapp när activeStep > 0.
|
|
1008
|
+
* Visar "Nästa"-knappen fram tills sista steget.
|
|
1009
|
+
* Byter "Nästa"-knappen till "Skicka" vid sista steget.
|
|
1010
|
+
*
|
|
1011
|
+
* @param {Object} globalLanguageState Objekt med språksträngar för knapparna.
|
|
1012
|
+
* Förväntas innehålla: backButton, forwardButton, sendButton.
|
|
1013
|
+
*
|
|
1014
|
+
* @param {Function} changeStepHandler Callback när användaren går bakåt i stegen.
|
|
1015
|
+
*
|
|
1016
|
+
* @param {Function} nextStepButtonHandler Callback när användaren går till nästa steg.
|
|
1017
|
+
*
|
|
1018
|
+
* @param {Function} onSubmitHandler Callback när sista steget nås och formuläret ska skickas in.
|
|
1019
|
+
*
|
|
1020
|
+
* @param {Array} steps Lista över alla steg i formuläret.
|
|
1021
|
+
* Används för att räkna ut sista stegnumret.
|
|
1022
|
+
*
|
|
1023
|
+
* @param {number} activeStep Det aktuella steget i flerstegsformuläret.
|
|
1024
|
+
*/
|
|
1025
|
+
declare const StepperButtonsNoApi: FC<StepperButtonsNoApiProps>;
|
|
1026
|
+
|
|
985
1027
|
interface ValidationErrorSummaryListProps {
|
|
986
1028
|
questions: any[];
|
|
987
1029
|
activatedLanguage: string;
|
|
@@ -1011,4 +1053,4 @@ interface FormStatusMessagesProps {
|
|
|
1011
1053
|
*/
|
|
1012
1054
|
declare const FormStatusMessagesScreenReader: React$1.FC<FormStatusMessagesProps>;
|
|
1013
1055
|
|
|
1014
|
-
export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, 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, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as
|
|
1056
|
+
export { AddFiles as AddFilesStandard, AlertInTextStandard, CheckboxGroup as CheckboxGroupStandard, Collapse, 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, InputInfoOnly as InfoOnlyStandard, type LanguageSupportConfig, LinkList as LinkListStandard, LinkStandard, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, Navigation, NavigationHeader, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, RadioWithInfo as RadioMultipleWithInfo2Standard, SearchBar, SingleCheckbox as SingleCheckboxStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtonsNoApi as StepperButtonsNoApiStandard, 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
|
@@ -50,11 +50,12 @@ __export(index_exports, {
|
|
|
50
50
|
QuestionGroup: () => QuestionGroup_default,
|
|
51
51
|
QuestionRenderer: () => QuestionRenderer_default,
|
|
52
52
|
RadioMultipleStandard: () => RadioMultipleStandard_default,
|
|
53
|
-
|
|
53
|
+
RadioMultipleWithInfo2Standard: () => RadioMultipleWithInfo2Standard_default,
|
|
54
54
|
SearchBar: () => SearchBarStandard_default,
|
|
55
55
|
SingleCheckboxStandard: () => SingleCheckboxStandard_default,
|
|
56
56
|
SkipLinkStandard: () => SkipLinkStandard_default,
|
|
57
57
|
StartApplicationButton: () => StartApplicationButton_default,
|
|
58
|
+
StepperButtonsNoApiStandard: () => StepperButtonsNoApiStandard_default,
|
|
58
59
|
StepperButtonsStandard: () => StepperButtonsStandard_default,
|
|
59
60
|
StepperStandard: () => StepperStandard_default,
|
|
60
61
|
TextAreaStandard: () => TextAreaStandard_default,
|
|
@@ -1510,10 +1511,10 @@ var InputInfoOnly = ({
|
|
|
1510
1511
|
};
|
|
1511
1512
|
var InfoOnlyStandard_default = InputInfoOnly;
|
|
1512
1513
|
|
|
1513
|
-
// src/components/input-components/
|
|
1514
|
+
// src/components/input-components/RadioMultipleWithInfo2Standard/RadioMultipleWithInfo2Standard.tsx
|
|
1514
1515
|
var import_react11 = __toESM(require("react"));
|
|
1515
1516
|
|
|
1516
|
-
// src/components/input-components/
|
|
1517
|
+
// src/components/input-components/RadioMultipleWithInfo2Standard/RadioCollapseItem.tsx
|
|
1517
1518
|
var import_react10 = require("react");
|
|
1518
1519
|
var import_dompurify6 = __toESM(require("dompurify"));
|
|
1519
1520
|
|
|
@@ -1958,7 +1959,7 @@ var Logo_en = () => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("svg", { widt
|
|
|
1958
1959
|
)
|
|
1959
1960
|
] });
|
|
1960
1961
|
|
|
1961
|
-
// src/components/input-components/
|
|
1962
|
+
// src/components/input-components/RadioMultipleWithInfo2Standard/RadioCollapseItem.tsx
|
|
1962
1963
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1963
1964
|
var RadioCollapseItem = ({
|
|
1964
1965
|
index,
|
|
@@ -2036,7 +2037,7 @@ var RadioCollapseItem = ({
|
|
|
2036
2037
|
};
|
|
2037
2038
|
var RadioCollapseItem_default = RadioCollapseItem;
|
|
2038
2039
|
|
|
2039
|
-
// src/components/input-components/
|
|
2040
|
+
// src/components/input-components/RadioMultipleWithInfo2Standard/RadioMultipleWithInfo2Standard.tsx
|
|
2040
2041
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2041
2042
|
var RadioWithInfo = ({
|
|
2042
2043
|
question,
|
|
@@ -2070,7 +2071,7 @@ var RadioWithInfo = ({
|
|
|
2070
2071
|
}
|
|
2071
2072
|
const groupedOptionArray = groupByCategoryArray((_a = question.options) != null ? _a : []);
|
|
2072
2073
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2073
|
-
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pts-root-question pts-
|
|
2074
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pts-root-question pts-radioMultipleWithInfo2-container", id: questionId, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2074
2075
|
"fieldset",
|
|
2075
2076
|
{
|
|
2076
2077
|
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
@@ -2086,28 +2087,26 @@ var RadioWithInfo = ({
|
|
|
2086
2087
|
let subId = "subheading-" + g_index;
|
|
2087
2088
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react11.default.Fragment, { children: [
|
|
2088
2089
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "pts-radioWithInfo-sub-headline", id: subId, children: group.category }),
|
|
2089
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "group", "aria-labelledby": subId, children: (_a2 = group.items) == null ? void 0 : _a2.map(
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
}
|
|
2110
|
-
) })
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "group", "aria-labelledby": subId, children: (_a2 = group.items) == null ? void 0 : _a2.map((option, o_index) => {
|
|
2091
|
+
var _a3, _b2, _c2, _d, _e;
|
|
2092
|
+
index++;
|
|
2093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2094
|
+
RadioCollapseItem_default,
|
|
2095
|
+
{
|
|
2096
|
+
label: option.label,
|
|
2097
|
+
index,
|
|
2098
|
+
questionId,
|
|
2099
|
+
groupId,
|
|
2100
|
+
value: (_a3 = option.value) != null ? _a3 : "",
|
|
2101
|
+
questionAnswer: (_b2 = question.answer) != null ? _b2 : "",
|
|
2102
|
+
handleInputChange,
|
|
2103
|
+
initialOpen: question.answer === option.value,
|
|
2104
|
+
questionIsMandatory: (_c2 = question.isQuestionMandatory) != null ? _c2 : false,
|
|
2105
|
+
optionText: (_e = (_d = group.items.find((optionInfo) => optionInfo.value === option.value)) == null ? void 0 : _d.info) != null ? _e : "",
|
|
2106
|
+
activatedLanguage
|
|
2107
|
+
}
|
|
2108
|
+
);
|
|
2109
|
+
}) })
|
|
2111
2110
|
] }, subId);
|
|
2112
2111
|
}),
|
|
2113
2112
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
@@ -2125,16 +2124,23 @@ var RadioWithInfo = ({
|
|
|
2125
2124
|
showPreview && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PreviewRadio2, { question })
|
|
2126
2125
|
] });
|
|
2127
2126
|
};
|
|
2128
|
-
var
|
|
2127
|
+
var RadioMultipleWithInfo2Standard_default = RadioWithInfo;
|
|
2129
2128
|
var PreviewRadio2 = ({ question }) => {
|
|
2130
2129
|
var _a, _b;
|
|
2131
2130
|
const previewId = `preview-${question.id}`;
|
|
2132
2131
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2133
2132
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
2134
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2133
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2135
2134
|
"dd",
|
|
2136
2135
|
{
|
|
2137
|
-
className: "pts-
|
|
2136
|
+
className: "pts-radioMultipleWithInfo2-preview pts-root-answer",
|
|
2137
|
+
id: `answer-${previewId}`,
|
|
2138
|
+
children: question.answer
|
|
2139
|
+
}
|
|
2140
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2141
|
+
"dd",
|
|
2142
|
+
{
|
|
2143
|
+
className: "pts-radioMultipleWithInfo2-preview pts-root-answer no-answer-preview-page",
|
|
2138
2144
|
id: `answer-${previewId}`,
|
|
2139
2145
|
children: "Inget svar"
|
|
2140
2146
|
}
|
|
@@ -2387,7 +2393,8 @@ var createGlobalLanguageSlice = (initialConfig, options) => {
|
|
|
2387
2393
|
languageSupportLoaded: true,
|
|
2388
2394
|
backButton: initialLang.backButton,
|
|
2389
2395
|
forwardButton: initialLang.forwardButton,
|
|
2390
|
-
sendButton: initialLang.sendButton
|
|
2396
|
+
sendButton: initialLang.sendButton,
|
|
2397
|
+
restartButton: initialLang.restartButton
|
|
2391
2398
|
};
|
|
2392
2399
|
const slice = (0, import_toolkit.createSlice)({
|
|
2393
2400
|
name,
|
|
@@ -2402,6 +2409,7 @@ var createGlobalLanguageSlice = (initialConfig, options) => {
|
|
|
2402
2409
|
state.backButton = lang.backButton;
|
|
2403
2410
|
state.forwardButton = lang.forwardButton;
|
|
2404
2411
|
state.sendButton = lang.sendButton;
|
|
2412
|
+
state.restartButton = lang.restartButton;
|
|
2405
2413
|
},
|
|
2406
2414
|
setGlobalLangauage: (state, action) => {
|
|
2407
2415
|
state.languageSupport = action.payload.languageSupport;
|
|
@@ -2410,6 +2418,7 @@ var createGlobalLanguageSlice = (initialConfig, options) => {
|
|
|
2410
2418
|
state.backButton = lang.backButton;
|
|
2411
2419
|
state.forwardButton = lang.forwardButton;
|
|
2412
2420
|
state.sendButton = lang.sendButton;
|
|
2421
|
+
state.restartButton = lang.restartButton;
|
|
2413
2422
|
state.languageSupportLoaded = true;
|
|
2414
2423
|
}
|
|
2415
2424
|
}
|
|
@@ -2432,7 +2441,8 @@ var makeglobalLanguageSelectors = (selectSlice) => {
|
|
|
2432
2441
|
...applicationContent,
|
|
2433
2442
|
backButton: match.backButton,
|
|
2434
2443
|
forwardButton: match.forwardButton,
|
|
2435
|
-
sendButton: match.sendButton
|
|
2444
|
+
sendButton: match.sendButton,
|
|
2445
|
+
restartButton: match.restartButton
|
|
2436
2446
|
};
|
|
2437
2447
|
}
|
|
2438
2448
|
);
|
|
@@ -2880,7 +2890,7 @@ var QuestionRenderer = ({
|
|
|
2880
2890
|
}
|
|
2881
2891
|
),
|
|
2882
2892
|
question.questionType === "RadioWithInfo" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2883
|
-
|
|
2893
|
+
RadioMultipleWithInfo2Standard_default,
|
|
2884
2894
|
{
|
|
2885
2895
|
question,
|
|
2886
2896
|
handleQuestionInputChange,
|
|
@@ -4252,8 +4262,55 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
|
4252
4262
|
};
|
|
4253
4263
|
var StepperStandard_default = Stepper;
|
|
4254
4264
|
|
|
4255
|
-
// src/components/
|
|
4265
|
+
// src/components/stepper/StepperButtonsNoApiStandard/StepperButtonsNoApiStandard.tsx
|
|
4256
4266
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4267
|
+
var StepperButtonsNoApi = ({
|
|
4268
|
+
globalLanguageState,
|
|
4269
|
+
changeStepHandler,
|
|
4270
|
+
nextStepButtonHandler,
|
|
4271
|
+
onSubmitHandler,
|
|
4272
|
+
steps,
|
|
4273
|
+
activeStep,
|
|
4274
|
+
appUsesResetButton = true
|
|
4275
|
+
}) => {
|
|
4276
|
+
const totalSteps = steps ? steps.length : "";
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "pts-stepperButtons-container", children: [
|
|
4278
|
+
activeStep === 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4279
|
+
"button",
|
|
4280
|
+
{
|
|
4281
|
+
type: "button",
|
|
4282
|
+
className: "pts-forwardButton",
|
|
4283
|
+
onClick: activeStep !== totalSteps ? nextStepButtonHandler : onSubmitHandler,
|
|
4284
|
+
children: activeStep !== totalSteps && globalLanguageState ? globalLanguageState.forwardButton : ""
|
|
4285
|
+
}
|
|
4286
|
+
) }),
|
|
4287
|
+
activeStep !== 0 && activeStep !== totalSteps && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
4288
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4289
|
+
"button",
|
|
4290
|
+
{
|
|
4291
|
+
onClick: () => changeStepHandler(activeStep - 1),
|
|
4292
|
+
className: "pts-backButton",
|
|
4293
|
+
type: "button",
|
|
4294
|
+
children: globalLanguageState ? globalLanguageState.backButton : "<<"
|
|
4295
|
+
}
|
|
4296
|
+
),
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4298
|
+
"button",
|
|
4299
|
+
{
|
|
4300
|
+
type: "button",
|
|
4301
|
+
className: "pts-forwardButton",
|
|
4302
|
+
onClick: activeStep !== totalSteps ? nextStepButtonHandler : onSubmitHandler,
|
|
4303
|
+
children: activeStep !== totalSteps && globalLanguageState ? globalLanguageState.forwardButton : ""
|
|
4304
|
+
}
|
|
4305
|
+
)
|
|
4306
|
+
] }),
|
|
4307
|
+
appUsesResetButton && activeStep === totalSteps && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { onClick: () => changeStepHandler(0), className: "pts-backButton", type: "button", children: globalLanguageState && globalLanguageState.restartButton ? globalLanguageState.restartButton : "Starta om" })
|
|
4308
|
+
] });
|
|
4309
|
+
};
|
|
4310
|
+
var StepperButtonsNoApiStandard_default = StepperButtonsNoApi;
|
|
4311
|
+
|
|
4312
|
+
// src/components/validation-and-status/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
|
|
4313
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4257
4314
|
var ValidationErrorSummaryList = ({
|
|
4258
4315
|
validationErrorsList,
|
|
4259
4316
|
questions,
|
|
@@ -4290,7 +4347,7 @@ var ValidationErrorSummaryList = ({
|
|
|
4290
4347
|
}, 300);
|
|
4291
4348
|
}
|
|
4292
4349
|
}
|
|
4293
|
-
if (!validationErrorsList.length) return /* @__PURE__ */ (0,
|
|
4350
|
+
if (!validationErrorsList.length) return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, {});
|
|
4294
4351
|
const filteredIds = filterIdsByGroupCheck(validationErrorsList, questions);
|
|
4295
4352
|
const count = filteredIds.length;
|
|
4296
4353
|
const title = summaryText.replace("{count}", count.toString()).replace(
|
|
@@ -4302,11 +4359,11 @@ var ValidationErrorSummaryList = ({
|
|
|
4302
4359
|
const found = questions.find((item) => item.id === id);
|
|
4303
4360
|
return (_a = found == null ? void 0 : found.validationSummaryLabel) != null ? _a : found == null ? void 0 : found.questionLabel;
|
|
4304
4361
|
}
|
|
4305
|
-
return /* @__PURE__ */ (0,
|
|
4306
|
-
/* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4308
|
-
/* @__PURE__ */ (0,
|
|
4309
|
-
/* @__PURE__ */ (0,
|
|
4362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: `pts-errorSummary-container pts-root-error ${validationErrorsList.length === 0 ? "cleanPadding" : ""}`, children: [
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
|
|
4365
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { id: "errorSummary-headline", children: title }),
|
|
4366
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4310
4367
|
"a",
|
|
4311
4368
|
{
|
|
4312
4369
|
href: "#",
|
|
@@ -4324,11 +4381,11 @@ var ValidationErrorSummaryList = ({
|
|
|
4324
4381
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
4325
4382
|
|
|
4326
4383
|
// src/components/validation-and-status/FormStatusMessagesScreenReader/FormStatusMessagesScreenReader.tsx
|
|
4327
|
-
var
|
|
4384
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4328
4385
|
var FormStatusMessagesScreenReader = ({ formStatus, activatedLanguage = "sv" }) => {
|
|
4329
|
-
return /* @__PURE__ */ (0,
|
|
4330
|
-
/* @__PURE__ */ (0,
|
|
4331
|
-
/* @__PURE__ */ (0,
|
|
4386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime43.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!" }) }),
|
|
4388
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.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." : "" })
|
|
4332
4389
|
] });
|
|
4333
4390
|
};
|
|
4334
4391
|
var FormStatusMessagesScreenReader_default = FormStatusMessagesScreenReader;
|
|
@@ -4354,11 +4411,12 @@ var FormStatusMessagesScreenReader_default = FormStatusMessagesScreenReader;
|
|
|
4354
4411
|
QuestionGroup,
|
|
4355
4412
|
QuestionRenderer,
|
|
4356
4413
|
RadioMultipleStandard,
|
|
4357
|
-
|
|
4414
|
+
RadioMultipleWithInfo2Standard,
|
|
4358
4415
|
SearchBar,
|
|
4359
4416
|
SingleCheckboxStandard,
|
|
4360
4417
|
SkipLinkStandard,
|
|
4361
4418
|
StartApplicationButton,
|
|
4419
|
+
StepperButtonsNoApiStandard,
|
|
4362
4420
|
StepperButtonsStandard,
|
|
4363
4421
|
StepperStandard,
|
|
4364
4422
|
TextAreaStandard,
|