optimized-react-component-library-xyz123 0.1.125 → 0.1.127
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 +48 -53
- package/dist/index.d.ts +48 -53
- package/dist/index.js +50 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,27 +6,34 @@ import * as immer from 'immer';
|
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
interface IApplicationContent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
headline?: string;
|
|
10
|
+
body?: string;
|
|
11
11
|
linksForMoreInfo?: Array<IPTSLink>;
|
|
12
12
|
pageTitle?: string;
|
|
13
13
|
textblocks?: Array<ITextBlock>;
|
|
14
14
|
languageSupport: [
|
|
15
15
|
{
|
|
16
16
|
language: string;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
headline: string;
|
|
18
|
+
body: string;
|
|
19
19
|
linksForMoreInfo: Array<IPTSLink>;
|
|
20
20
|
pageTitle: string;
|
|
21
21
|
textblocks: Array<ITextBlock>;
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
|
+
interface ITextBlock {
|
|
26
|
+
id?: string;
|
|
27
|
+
headline?: string;
|
|
28
|
+
body?: string;
|
|
29
|
+
linksForMoreInfo?: Array<IPTSLink>;
|
|
30
|
+
pageTitle?: string;
|
|
31
|
+
}
|
|
25
32
|
interface IFormState {
|
|
26
33
|
applicationContent: IApplicationContent;
|
|
27
34
|
steps: Array<IStepObject>;
|
|
28
35
|
questions: Array<IQuestion>;
|
|
29
|
-
|
|
36
|
+
formLoaded: boolean;
|
|
30
37
|
status: 'notloaded' | 'idle' | 'loading' | 'failed' | 'success';
|
|
31
38
|
}
|
|
32
39
|
interface IOption {
|
|
@@ -46,13 +53,6 @@ interface IStepObject {
|
|
|
46
53
|
shortNameInPreview?: string;
|
|
47
54
|
languageSupport?: Array<any>;
|
|
48
55
|
}
|
|
49
|
-
interface ITextBlock {
|
|
50
|
-
id?: string;
|
|
51
|
-
headline?: string;
|
|
52
|
-
body?: string;
|
|
53
|
-
linksForMoreInfo?: Array<IPTSLink>;
|
|
54
|
-
pageTitle?: string;
|
|
55
|
-
}
|
|
56
56
|
interface IQuestion {
|
|
57
57
|
id?: number;
|
|
58
58
|
mappingId?: string;
|
|
@@ -274,7 +274,6 @@ declare function findVisibleQuestionsWithValidationErrors(data: any, formQuestio
|
|
|
274
274
|
*/
|
|
275
275
|
declare function buildStepCategoryGroupQuestionStructure(questions: IQuestion[], steps: IStepObject[], validationErrorsList: number[]): any[];
|
|
276
276
|
|
|
277
|
-
/** ----- Typer ----- */
|
|
278
277
|
interface LanguageEntry {
|
|
279
278
|
language: string;
|
|
280
279
|
backButton: string;
|
|
@@ -293,21 +292,17 @@ interface LanguageState {
|
|
|
293
292
|
forwardButton: string;
|
|
294
293
|
sendButton: string;
|
|
295
294
|
}
|
|
296
|
-
|
|
297
|
-
declare const createLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
295
|
+
declare const createGlobalLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
298
296
|
name?: string;
|
|
299
297
|
}) => _reduxjs_toolkit.Slice<LanguageState, {
|
|
300
298
|
setActivatedLanguage: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<string>) => void;
|
|
301
|
-
|
|
302
|
-
replaceLanguageSupport: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
|
|
299
|
+
setGlobalLangauage: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
|
|
303
300
|
}, string, string, _reduxjs_toolkit.SliceSelectors<LanguageState>>;
|
|
304
|
-
|
|
305
|
-
declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
|
|
301
|
+
declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
|
|
306
302
|
selectActivatedLanguage: (state: TState) => string;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
selectOverallContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
|
|
303
|
+
selectGlobalLanguageLoaded: (state: TState) => boolean;
|
|
304
|
+
selectGlobalLanguageState: (state: TState) => LanguageState;
|
|
305
|
+
selectGlobalLanguage: ((state: TState, activatedLanguage: string) => {
|
|
311
306
|
activatedLanguage: string;
|
|
312
307
|
languageSupport: LanguageEntry[];
|
|
313
308
|
languageSupportLoaded: boolean;
|
|
@@ -358,32 +353,32 @@ declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => La
|
|
|
358
353
|
};
|
|
359
354
|
};
|
|
360
355
|
|
|
361
|
-
declare const
|
|
356
|
+
declare const createFormSlice: (initialState: IFormState, options?: {
|
|
362
357
|
name?: string;
|
|
363
358
|
extraReducers?: (builder: ActionReducerMapBuilder<IFormState>) => void;
|
|
364
359
|
}) => _reduxjs_toolkit.Slice<IFormState, {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
360
|
+
setApplicationContent: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
361
|
+
setStep: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
362
|
+
setQuestion: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
363
|
+
updateAnswer: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
364
|
+
addFiles: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
365
|
+
hideQuestionsFromStep: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
366
|
+
setQuestionDisplayed: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
367
|
+
resetDependentAnswersForward: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
373
368
|
}, string, string, _reduxjs_toolkit.SliceSelectors<IFormState>>;
|
|
374
|
-
declare const
|
|
375
|
-
|
|
376
|
-
|
|
369
|
+
declare const makeFormSelectors: <TState>(selectSlice: (state: TState) => IFormState) => {
|
|
370
|
+
selectFormState: (state: TState) => IFormState;
|
|
371
|
+
selectIsFormLoaded: (state: TState) => boolean;
|
|
377
372
|
selectApplicationContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
|
|
378
|
-
|
|
379
|
-
|
|
373
|
+
headline: string;
|
|
374
|
+
body: string;
|
|
380
375
|
linksForMoreInfo: never[];
|
|
381
376
|
pageTitle: string;
|
|
382
377
|
textblocks: never[];
|
|
383
378
|
languageSupport?: undefined;
|
|
384
379
|
} | {
|
|
385
|
-
|
|
386
|
-
|
|
380
|
+
headline: any;
|
|
381
|
+
body: any;
|
|
387
382
|
linksForMoreInfo: any;
|
|
388
383
|
pageTitle: any;
|
|
389
384
|
textblocks: any;
|
|
@@ -394,30 +389,30 @@ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => I
|
|
|
394
389
|
resetResultsCount: () => void;
|
|
395
390
|
} & {
|
|
396
391
|
resultFunc: (resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
|
|
397
|
-
|
|
398
|
-
|
|
392
|
+
headline: string;
|
|
393
|
+
body: string;
|
|
399
394
|
linksForMoreInfo: never[];
|
|
400
395
|
pageTitle: string;
|
|
401
396
|
textblocks: never[];
|
|
402
397
|
languageSupport?: undefined;
|
|
403
398
|
} | {
|
|
404
|
-
|
|
405
|
-
|
|
399
|
+
headline: any;
|
|
400
|
+
body: any;
|
|
406
401
|
linksForMoreInfo: any;
|
|
407
402
|
pageTitle: any;
|
|
408
403
|
textblocks: any;
|
|
409
404
|
languageSupport: any;
|
|
410
405
|
};
|
|
411
406
|
memoizedResultFunc: ((resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
|
|
412
|
-
|
|
413
|
-
|
|
407
|
+
headline: string;
|
|
408
|
+
body: string;
|
|
414
409
|
linksForMoreInfo: never[];
|
|
415
410
|
pageTitle: string;
|
|
416
411
|
textblocks: never[];
|
|
417
412
|
languageSupport?: undefined;
|
|
418
413
|
} | {
|
|
419
|
-
|
|
420
|
-
|
|
414
|
+
headline: any;
|
|
415
|
+
body: any;
|
|
421
416
|
linksForMoreInfo: any;
|
|
422
417
|
pageTitle: any;
|
|
423
418
|
textblocks: any;
|
|
@@ -428,15 +423,15 @@ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => I
|
|
|
428
423
|
resetResultsCount: () => void;
|
|
429
424
|
};
|
|
430
425
|
lastResult: () => {
|
|
431
|
-
|
|
432
|
-
|
|
426
|
+
headline: string;
|
|
427
|
+
body: string;
|
|
433
428
|
linksForMoreInfo: never[];
|
|
434
429
|
pageTitle: string;
|
|
435
430
|
textblocks: never[];
|
|
436
431
|
languageSupport?: undefined;
|
|
437
432
|
} | {
|
|
438
|
-
|
|
439
|
-
|
|
433
|
+
headline: any;
|
|
434
|
+
body: any;
|
|
440
435
|
linksForMoreInfo: any;
|
|
441
436
|
pageTitle: any;
|
|
442
437
|
textblocks: any;
|
|
@@ -659,7 +654,7 @@ interface PrincipleOfPublicityProps {
|
|
|
659
654
|
declare const PrincipleOfPublicity: FC<PrincipleOfPublicityProps>;
|
|
660
655
|
|
|
661
656
|
interface TextBodyProps {
|
|
662
|
-
data: ITextBlock;
|
|
657
|
+
data: ITextBlock | IApplicationContent;
|
|
663
658
|
}
|
|
664
659
|
|
|
665
660
|
declare const TextBody: FC<TextBodyProps>;
|
|
@@ -718,4 +713,4 @@ interface FormStatusMessagesProps {
|
|
|
718
713
|
*/
|
|
719
714
|
declare const FormStatusMessagesScreenReader: React.FC<FormStatusMessagesProps>;
|
|
720
715
|
|
|
721
|
-
export { AddFiles as AddFilesStandard, 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, InfoOnly as InfoOnlyStandard, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createLanguageSlice, createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
|
716
|
+
export { AddFiles as AddFilesStandard, 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, InfoOnly as InfoOnlyStandard, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,27 +6,34 @@ import * as immer from 'immer';
|
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
interface IApplicationContent {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
headline?: string;
|
|
10
|
+
body?: string;
|
|
11
11
|
linksForMoreInfo?: Array<IPTSLink>;
|
|
12
12
|
pageTitle?: string;
|
|
13
13
|
textblocks?: Array<ITextBlock>;
|
|
14
14
|
languageSupport: [
|
|
15
15
|
{
|
|
16
16
|
language: string;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
headline: string;
|
|
18
|
+
body: string;
|
|
19
19
|
linksForMoreInfo: Array<IPTSLink>;
|
|
20
20
|
pageTitle: string;
|
|
21
21
|
textblocks: Array<ITextBlock>;
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
|
+
interface ITextBlock {
|
|
26
|
+
id?: string;
|
|
27
|
+
headline?: string;
|
|
28
|
+
body?: string;
|
|
29
|
+
linksForMoreInfo?: Array<IPTSLink>;
|
|
30
|
+
pageTitle?: string;
|
|
31
|
+
}
|
|
25
32
|
interface IFormState {
|
|
26
33
|
applicationContent: IApplicationContent;
|
|
27
34
|
steps: Array<IStepObject>;
|
|
28
35
|
questions: Array<IQuestion>;
|
|
29
|
-
|
|
36
|
+
formLoaded: boolean;
|
|
30
37
|
status: 'notloaded' | 'idle' | 'loading' | 'failed' | 'success';
|
|
31
38
|
}
|
|
32
39
|
interface IOption {
|
|
@@ -46,13 +53,6 @@ interface IStepObject {
|
|
|
46
53
|
shortNameInPreview?: string;
|
|
47
54
|
languageSupport?: Array<any>;
|
|
48
55
|
}
|
|
49
|
-
interface ITextBlock {
|
|
50
|
-
id?: string;
|
|
51
|
-
headline?: string;
|
|
52
|
-
body?: string;
|
|
53
|
-
linksForMoreInfo?: Array<IPTSLink>;
|
|
54
|
-
pageTitle?: string;
|
|
55
|
-
}
|
|
56
56
|
interface IQuestion {
|
|
57
57
|
id?: number;
|
|
58
58
|
mappingId?: string;
|
|
@@ -274,7 +274,6 @@ declare function findVisibleQuestionsWithValidationErrors(data: any, formQuestio
|
|
|
274
274
|
*/
|
|
275
275
|
declare function buildStepCategoryGroupQuestionStructure(questions: IQuestion[], steps: IStepObject[], validationErrorsList: number[]): any[];
|
|
276
276
|
|
|
277
|
-
/** ----- Typer ----- */
|
|
278
277
|
interface LanguageEntry {
|
|
279
278
|
language: string;
|
|
280
279
|
backButton: string;
|
|
@@ -293,21 +292,17 @@ interface LanguageState {
|
|
|
293
292
|
forwardButton: string;
|
|
294
293
|
sendButton: string;
|
|
295
294
|
}
|
|
296
|
-
|
|
297
|
-
declare const createLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
295
|
+
declare const createGlobalLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
298
296
|
name?: string;
|
|
299
297
|
}) => _reduxjs_toolkit.Slice<LanguageState, {
|
|
300
298
|
setActivatedLanguage: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<string>) => void;
|
|
301
|
-
|
|
302
|
-
replaceLanguageSupport: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
|
|
299
|
+
setGlobalLangauage: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
|
|
303
300
|
}, string, string, _reduxjs_toolkit.SliceSelectors<LanguageState>>;
|
|
304
|
-
|
|
305
|
-
declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
|
|
301
|
+
declare const makeglobalLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
|
|
306
302
|
selectActivatedLanguage: (state: TState) => string;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
selectOverallContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
|
|
303
|
+
selectGlobalLanguageLoaded: (state: TState) => boolean;
|
|
304
|
+
selectGlobalLanguageState: (state: TState) => LanguageState;
|
|
305
|
+
selectGlobalLanguage: ((state: TState, activatedLanguage: string) => {
|
|
311
306
|
activatedLanguage: string;
|
|
312
307
|
languageSupport: LanguageEntry[];
|
|
313
308
|
languageSupportLoaded: boolean;
|
|
@@ -358,32 +353,32 @@ declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => La
|
|
|
358
353
|
};
|
|
359
354
|
};
|
|
360
355
|
|
|
361
|
-
declare const
|
|
356
|
+
declare const createFormSlice: (initialState: IFormState, options?: {
|
|
362
357
|
name?: string;
|
|
363
358
|
extraReducers?: (builder: ActionReducerMapBuilder<IFormState>) => void;
|
|
364
359
|
}) => _reduxjs_toolkit.Slice<IFormState, {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
360
|
+
setApplicationContent: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
361
|
+
setStep: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
362
|
+
setQuestion: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
363
|
+
updateAnswer: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
364
|
+
addFiles: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
365
|
+
hideQuestionsFromStep: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
366
|
+
setQuestionDisplayed: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
367
|
+
resetDependentAnswersForward: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
|
|
373
368
|
}, string, string, _reduxjs_toolkit.SliceSelectors<IFormState>>;
|
|
374
|
-
declare const
|
|
375
|
-
|
|
376
|
-
|
|
369
|
+
declare const makeFormSelectors: <TState>(selectSlice: (state: TState) => IFormState) => {
|
|
370
|
+
selectFormState: (state: TState) => IFormState;
|
|
371
|
+
selectIsFormLoaded: (state: TState) => boolean;
|
|
377
372
|
selectApplicationContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
|
|
378
|
-
|
|
379
|
-
|
|
373
|
+
headline: string;
|
|
374
|
+
body: string;
|
|
380
375
|
linksForMoreInfo: never[];
|
|
381
376
|
pageTitle: string;
|
|
382
377
|
textblocks: never[];
|
|
383
378
|
languageSupport?: undefined;
|
|
384
379
|
} | {
|
|
385
|
-
|
|
386
|
-
|
|
380
|
+
headline: any;
|
|
381
|
+
body: any;
|
|
387
382
|
linksForMoreInfo: any;
|
|
388
383
|
pageTitle: any;
|
|
389
384
|
textblocks: any;
|
|
@@ -394,30 +389,30 @@ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => I
|
|
|
394
389
|
resetResultsCount: () => void;
|
|
395
390
|
} & {
|
|
396
391
|
resultFunc: (resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
|
|
397
|
-
|
|
398
|
-
|
|
392
|
+
headline: string;
|
|
393
|
+
body: string;
|
|
399
394
|
linksForMoreInfo: never[];
|
|
400
395
|
pageTitle: string;
|
|
401
396
|
textblocks: never[];
|
|
402
397
|
languageSupport?: undefined;
|
|
403
398
|
} | {
|
|
404
|
-
|
|
405
|
-
|
|
399
|
+
headline: any;
|
|
400
|
+
body: any;
|
|
406
401
|
linksForMoreInfo: any;
|
|
407
402
|
pageTitle: any;
|
|
408
403
|
textblocks: any;
|
|
409
404
|
languageSupport: any;
|
|
410
405
|
};
|
|
411
406
|
memoizedResultFunc: ((resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
|
|
412
|
-
|
|
413
|
-
|
|
407
|
+
headline: string;
|
|
408
|
+
body: string;
|
|
414
409
|
linksForMoreInfo: never[];
|
|
415
410
|
pageTitle: string;
|
|
416
411
|
textblocks: never[];
|
|
417
412
|
languageSupport?: undefined;
|
|
418
413
|
} | {
|
|
419
|
-
|
|
420
|
-
|
|
414
|
+
headline: any;
|
|
415
|
+
body: any;
|
|
421
416
|
linksForMoreInfo: any;
|
|
422
417
|
pageTitle: any;
|
|
423
418
|
textblocks: any;
|
|
@@ -428,15 +423,15 @@ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => I
|
|
|
428
423
|
resetResultsCount: () => void;
|
|
429
424
|
};
|
|
430
425
|
lastResult: () => {
|
|
431
|
-
|
|
432
|
-
|
|
426
|
+
headline: string;
|
|
427
|
+
body: string;
|
|
433
428
|
linksForMoreInfo: never[];
|
|
434
429
|
pageTitle: string;
|
|
435
430
|
textblocks: never[];
|
|
436
431
|
languageSupport?: undefined;
|
|
437
432
|
} | {
|
|
438
|
-
|
|
439
|
-
|
|
433
|
+
headline: any;
|
|
434
|
+
body: any;
|
|
440
435
|
linksForMoreInfo: any;
|
|
441
436
|
pageTitle: any;
|
|
442
437
|
textblocks: any;
|
|
@@ -659,7 +654,7 @@ interface PrincipleOfPublicityProps {
|
|
|
659
654
|
declare const PrincipleOfPublicity: FC<PrincipleOfPublicityProps>;
|
|
660
655
|
|
|
661
656
|
interface TextBodyProps {
|
|
662
|
-
data: ITextBlock;
|
|
657
|
+
data: ITextBlock | IApplicationContent;
|
|
663
658
|
}
|
|
664
659
|
|
|
665
660
|
declare const TextBody: FC<TextBodyProps>;
|
|
@@ -718,4 +713,4 @@ interface FormStatusMessagesProps {
|
|
|
718
713
|
*/
|
|
719
714
|
declare const FormStatusMessagesScreenReader: React.FC<FormStatusMessagesProps>;
|
|
720
715
|
|
|
721
|
-
export { AddFiles as AddFilesStandard, 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, InfoOnly as InfoOnlyStandard, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createLanguageSlice, createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
|
716
|
+
export { AddFiles as AddFilesStandard, 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, InfoOnly as InfoOnlyStandard, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, QuestionGroup, QuestionRenderer, InputRadio as RadioMultipleStandard, SkipLink as SkipLinkStandard, StartApplicationButton, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextBody, TextFieldStandard, ValidationErrorSummaryList, buildStepCategoryGroupQuestionStructure, createApiDataObject, createCookieConsent, createGlobalLanguageSlice as createLanguageSlice, createFormSlice as createQuestionsSlice, findVisibleQuestionsWithValidationErrors, focusElement, getGroupCheckIds, hasQuestionValidationError, isQuestionDependencySatisfied, isScriptLoaded, makeglobalLanguageSelectors as makeLanguageSelectors, makeFormSelectors as makeQuestionsSelectors, preparePreviewData, removeScriptById, toggleScriptByConsent, updateQuestionsAndCategoriesVisibilityAndErrors, useCookieConsent, useFormStatusModal, useInputMethodDetection, usePTSPageTitle };
|
package/dist/index.js
CHANGED
|
@@ -54,16 +54,16 @@ __export(index_exports, {
|
|
|
54
54
|
buildStepCategoryGroupQuestionStructure: () => buildStepCategoryGroupQuestionStructure_default,
|
|
55
55
|
createApiDataObject: () => createApiDataObject_default,
|
|
56
56
|
createCookieConsent: () => createCookieConsent,
|
|
57
|
-
createLanguageSlice: () =>
|
|
58
|
-
createQuestionsSlice: () =>
|
|
57
|
+
createLanguageSlice: () => createGlobalLanguageSlice,
|
|
58
|
+
createQuestionsSlice: () => createFormSlice,
|
|
59
59
|
findVisibleQuestionsWithValidationErrors: () => findVisibleQuestionsWithValidationErrors_default,
|
|
60
60
|
focusElement: () => focusElement,
|
|
61
61
|
getGroupCheckIds: () => getGroupCheckIds_default,
|
|
62
62
|
hasQuestionValidationError: () => hasQuestionValidationError_default,
|
|
63
63
|
isQuestionDependencySatisfied: () => isQuestionDependencySatisfied_default,
|
|
64
64
|
isScriptLoaded: () => isScriptLoaded,
|
|
65
|
-
makeLanguageSelectors: () =>
|
|
66
|
-
makeQuestionsSelectors: () =>
|
|
65
|
+
makeLanguageSelectors: () => makeglobalLanguageSelectors,
|
|
66
|
+
makeQuestionsSelectors: () => makeFormSelectors,
|
|
67
67
|
preparePreviewData: () => preparePreviewData_default,
|
|
68
68
|
removeScriptById: () => removeScriptById,
|
|
69
69
|
toggleScriptByConsent: () => toggleScriptByConsent,
|
|
@@ -1204,15 +1204,15 @@ function buildStepCategoryGroupQuestionStructure(questions, steps, validationErr
|
|
|
1204
1204
|
}
|
|
1205
1205
|
var buildStepCategoryGroupQuestionStructure_default = buildStepCategoryGroupQuestionStructure;
|
|
1206
1206
|
|
|
1207
|
-
// src/state/
|
|
1207
|
+
// src/state/globalLanguageSlice/globalLanguageSlice.ts
|
|
1208
1208
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
1209
1209
|
var pickLang = (cfg, lang) => {
|
|
1210
1210
|
var _a;
|
|
1211
1211
|
return (_a = cfg.languageSupport.find((l) => l.language === lang)) != null ? _a : cfg.languageSupport[0];
|
|
1212
1212
|
};
|
|
1213
|
-
var
|
|
1213
|
+
var createGlobalLanguageSlice = (initialConfig, options) => {
|
|
1214
1214
|
var _a;
|
|
1215
|
-
const name = (_a = options == null ? void 0 : options.name) != null ? _a : "
|
|
1215
|
+
const name = (_a = options == null ? void 0 : options.name) != null ? _a : "languageOverall";
|
|
1216
1216
|
const initialLang = pickLang(initialConfig, initialConfig.activatedLanguage);
|
|
1217
1217
|
const initialState = {
|
|
1218
1218
|
activatedLanguage: initialConfig.activatedLanguage,
|
|
@@ -1236,12 +1236,7 @@ var createLanguageSlice = (initialConfig, options) => {
|
|
|
1236
1236
|
state.forwardButton = lang.forwardButton;
|
|
1237
1237
|
state.sendButton = lang.sendButton;
|
|
1238
1238
|
},
|
|
1239
|
-
|
|
1240
|
-
state.backButton = action.payload.backButton;
|
|
1241
|
-
state.forwardButton = action.payload.forwardButton;
|
|
1242
|
-
state.sendButton = action.payload.sendButton;
|
|
1243
|
-
},
|
|
1244
|
-
replaceLanguageSupport: (state, action) => {
|
|
1239
|
+
setGlobalLangauage: (state, action) => {
|
|
1245
1240
|
state.languageSupport = action.payload.languageSupport;
|
|
1246
1241
|
state.activatedLanguage = action.payload.activatedLanguage;
|
|
1247
1242
|
const lang = pickLang(action.payload, action.payload.activatedLanguage);
|
|
@@ -1254,13 +1249,12 @@ var createLanguageSlice = (initialConfig, options) => {
|
|
|
1254
1249
|
});
|
|
1255
1250
|
return slice;
|
|
1256
1251
|
};
|
|
1257
|
-
var
|
|
1252
|
+
var makeglobalLanguageSelectors = (selectSlice) => {
|
|
1258
1253
|
const selectState = selectSlice;
|
|
1259
1254
|
const selectActivatedLanguage = (state) => selectState(state).activatedLanguage;
|
|
1260
|
-
const
|
|
1261
|
-
const
|
|
1262
|
-
const
|
|
1263
|
-
const selectOverallContentFromLanguageSupport = (0, import_toolkit.createSelector)(
|
|
1255
|
+
const selectGlobalLanguageLoaded = (state) => selectState(state).languageSupportLoaded;
|
|
1256
|
+
const selectGlobalLanguageState = (state) => selectState(state);
|
|
1257
|
+
const selectGlobalLanguage = (0, import_toolkit.createSelector)(
|
|
1264
1258
|
[selectState, (_, activatedLanguage) => activatedLanguage],
|
|
1265
1259
|
(applicationContent, activatedLanguage) => {
|
|
1266
1260
|
const match = applicationContent.languageSupport.find(
|
|
@@ -1277,54 +1271,46 @@ var makeLanguageSelectors = (selectSlice) => {
|
|
|
1277
1271
|
);
|
|
1278
1272
|
return {
|
|
1279
1273
|
selectActivatedLanguage,
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
selectOverallContentFromLanguageSupport
|
|
1274
|
+
selectGlobalLanguageLoaded,
|
|
1275
|
+
selectGlobalLanguageState,
|
|
1276
|
+
selectGlobalLanguage
|
|
1284
1277
|
};
|
|
1285
1278
|
};
|
|
1286
1279
|
|
|
1287
|
-
// src/state/
|
|
1280
|
+
// src/state/formSlice/formSlice.ts
|
|
1288
1281
|
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
1289
|
-
var
|
|
1282
|
+
var mapQuestionById = (questions, id, updater) => {
|
|
1283
|
+
return questions.map((q) => q.id === id ? updater(q) : q);
|
|
1284
|
+
};
|
|
1285
|
+
var createFormSlice = (initialState, options) => {
|
|
1290
1286
|
var _a;
|
|
1291
1287
|
const slice = (0, import_toolkit2.createSlice)({
|
|
1292
1288
|
name: (_a = options == null ? void 0 : options.name) != null ? _a : "Form",
|
|
1293
1289
|
initialState,
|
|
1294
1290
|
reducers: {
|
|
1295
|
-
|
|
1291
|
+
setApplicationContent: (state, action) => {
|
|
1296
1292
|
state.applicationContent = action.payload;
|
|
1297
|
-
state.
|
|
1293
|
+
state.formLoaded = true;
|
|
1298
1294
|
},
|
|
1299
|
-
|
|
1295
|
+
setStep: (state, action) => {
|
|
1300
1296
|
state.steps = action.payload;
|
|
1301
1297
|
},
|
|
1302
|
-
|
|
1298
|
+
setQuestion: (state, action) => {
|
|
1303
1299
|
state.questions = action.payload;
|
|
1304
1300
|
},
|
|
1305
|
-
|
|
1306
|
-
state.questions = state.questions.
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
answer: action.payload.answer
|
|
1311
|
-
};
|
|
1312
|
-
}
|
|
1313
|
-
return qObject;
|
|
1314
|
-
});
|
|
1301
|
+
updateAnswer: (state, action) => {
|
|
1302
|
+
state.questions = mapQuestionById(state.questions, action.payload.id, (q) => ({
|
|
1303
|
+
...q,
|
|
1304
|
+
answer: action.payload.answer
|
|
1305
|
+
}));
|
|
1315
1306
|
},
|
|
1316
|
-
|
|
1317
|
-
state.questions = state.questions.
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
files: action.payload.files
|
|
1322
|
-
};
|
|
1323
|
-
}
|
|
1324
|
-
return qObject;
|
|
1325
|
-
});
|
|
1307
|
+
addFiles: (state, action) => {
|
|
1308
|
+
state.questions = mapQuestionById(state.questions, action.payload.id, (q) => ({
|
|
1309
|
+
...q,
|
|
1310
|
+
files: action.payload.files
|
|
1311
|
+
}));
|
|
1326
1312
|
},
|
|
1327
|
-
|
|
1313
|
+
hideQuestionsFromStep: (state, action) => {
|
|
1328
1314
|
const { activeStep } = action.payload;
|
|
1329
1315
|
state.questions = state.questions.map((qObject) => {
|
|
1330
1316
|
if (qObject.step >= activeStep) {
|
|
@@ -1336,18 +1322,13 @@ var createQuestionsSlice = (initialState, options) => {
|
|
|
1336
1322
|
return qObject;
|
|
1337
1323
|
});
|
|
1338
1324
|
},
|
|
1339
|
-
|
|
1340
|
-
state.questions = state.questions.
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
isDisplayed: action.payload.isDisplayed
|
|
1345
|
-
};
|
|
1346
|
-
}
|
|
1347
|
-
return qObject;
|
|
1348
|
-
});
|
|
1325
|
+
setQuestionDisplayed: (state, action) => {
|
|
1326
|
+
state.questions = mapQuestionById(state.questions, action.payload.id, (q) => ({
|
|
1327
|
+
...q,
|
|
1328
|
+
isDisplayed: action.payload.isDisplayed
|
|
1329
|
+
}));
|
|
1349
1330
|
},
|
|
1350
|
-
|
|
1331
|
+
resetDependentAnswersForward: (state, action) => {
|
|
1351
1332
|
state.questions = state.questions.map((qObject) => {
|
|
1352
1333
|
let questionExistInLinkedToQuestion = false;
|
|
1353
1334
|
if (qObject.dependsOnOtherQuestion !== void 0) {
|
|
@@ -1374,9 +1355,9 @@ var createQuestionsSlice = (initialState, options) => {
|
|
|
1374
1355
|
});
|
|
1375
1356
|
return slice;
|
|
1376
1357
|
};
|
|
1377
|
-
var
|
|
1378
|
-
const
|
|
1379
|
-
const
|
|
1358
|
+
var makeFormSelectors = (selectSlice) => {
|
|
1359
|
+
const selectFormState = (state) => selectSlice(state);
|
|
1360
|
+
const selectIsFormLoaded = (state) => selectSlice(state).formLoaded;
|
|
1380
1361
|
const selectApplicationContentFromLanguageSupport = (0, import_toolkit2.createSelector)(
|
|
1381
1362
|
[
|
|
1382
1363
|
(state) => selectSlice(state).applicationContent,
|
|
@@ -1389,16 +1370,16 @@ var makeQuestionsSelectors = (selectSlice) => {
|
|
|
1389
1370
|
);
|
|
1390
1371
|
if (!languageSupport) {
|
|
1391
1372
|
return {
|
|
1392
|
-
|
|
1393
|
-
|
|
1373
|
+
headline: "",
|
|
1374
|
+
body: "",
|
|
1394
1375
|
linksForMoreInfo: [],
|
|
1395
1376
|
pageTitle: "",
|
|
1396
1377
|
textblocks: []
|
|
1397
1378
|
};
|
|
1398
1379
|
}
|
|
1399
1380
|
return {
|
|
1400
|
-
|
|
1401
|
-
|
|
1381
|
+
headline: languageSupport.headline,
|
|
1382
|
+
body: languageSupport.body,
|
|
1402
1383
|
linksForMoreInfo: languageSupport.linksForMoreInfo,
|
|
1403
1384
|
pageTitle: languageSupport.pageTitle,
|
|
1404
1385
|
textblocks: languageSupport.textblocks,
|
|
@@ -1458,8 +1439,8 @@ var makeQuestionsSelectors = (selectSlice) => {
|
|
|
1458
1439
|
}
|
|
1459
1440
|
);
|
|
1460
1441
|
return {
|
|
1461
|
-
|
|
1462
|
-
|
|
1442
|
+
selectFormState,
|
|
1443
|
+
selectIsFormLoaded,
|
|
1463
1444
|
selectApplicationContentFromLanguageSupport,
|
|
1464
1445
|
selectStepFromLanguageSupport,
|
|
1465
1446
|
selectQuestionFromLanguageSupport
|