optimized-react-component-library-xyz123 0.1.93 → 0.1.95

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from 'react';
2
2
  import * as reselect from 'reselect';
3
3
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
- import { PayloadAction } from '@reduxjs/toolkit';
4
+ import { PayloadAction, ActionReducerMapBuilder } from '@reduxjs/toolkit';
5
5
  import * as immer from 'immer';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
@@ -309,6 +309,156 @@ declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => La
309
309
  };
310
310
  };
311
311
 
312
+ declare const createQuestionsSlice: (initialState: IFormState, options?: {
313
+ name?: string;
314
+ extraReducers?: (builder: ActionReducerMapBuilder<IFormState>) => void;
315
+ }) => _reduxjs_toolkit.Slice<IFormState, {
316
+ AddApplicationContentFromLanguageSupport: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
317
+ AddStepsFromLanguageSupport: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
318
+ AddQuestionsFromLanguageSupport: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
319
+ AddAnswer: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
320
+ AddFiles: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
321
+ RemoveAllQuestionsDisplayedInStep: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
322
+ AddQuestionDisplayed: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
323
+ RemoveAllAnswersForward: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
324
+ }, string, string, _reduxjs_toolkit.SliceSelectors<IFormState>>;
325
+ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => IFormState) => {
326
+ selectStateQuestion: (state: TState) => IFormState;
327
+ selectIsQuestionLoaded: (state: TState) => boolean;
328
+ selectApplicationContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
329
+ mainHeadline: string;
330
+ ingressBody: string;
331
+ linksForMoreInfo: never[];
332
+ pageTitle: string;
333
+ textblocks: never[];
334
+ languageSupport?: undefined;
335
+ } | {
336
+ mainHeadline: any;
337
+ ingressBody: any;
338
+ linksForMoreInfo: any;
339
+ pageTitle: any;
340
+ textblocks: any;
341
+ languageSupport: any;
342
+ }) & {
343
+ clearCache: () => void;
344
+ resultsCount: () => number;
345
+ resetResultsCount: () => void;
346
+ } & {
347
+ resultFunc: (resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
348
+ mainHeadline: string;
349
+ ingressBody: string;
350
+ linksForMoreInfo: never[];
351
+ pageTitle: string;
352
+ textblocks: never[];
353
+ languageSupport?: undefined;
354
+ } | {
355
+ mainHeadline: any;
356
+ ingressBody: any;
357
+ linksForMoreInfo: any;
358
+ pageTitle: any;
359
+ textblocks: any;
360
+ languageSupport: any;
361
+ };
362
+ memoizedResultFunc: ((resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
363
+ mainHeadline: string;
364
+ ingressBody: string;
365
+ linksForMoreInfo: never[];
366
+ pageTitle: string;
367
+ textblocks: never[];
368
+ languageSupport?: undefined;
369
+ } | {
370
+ mainHeadline: any;
371
+ ingressBody: any;
372
+ linksForMoreInfo: any;
373
+ pageTitle: any;
374
+ textblocks: any;
375
+ languageSupport: any;
376
+ }) & {
377
+ clearCache: () => void;
378
+ resultsCount: () => number;
379
+ resetResultsCount: () => void;
380
+ };
381
+ lastResult: () => {
382
+ mainHeadline: string;
383
+ ingressBody: string;
384
+ linksForMoreInfo: never[];
385
+ pageTitle: string;
386
+ textblocks: never[];
387
+ languageSupport?: undefined;
388
+ } | {
389
+ mainHeadline: any;
390
+ ingressBody: any;
391
+ linksForMoreInfo: any;
392
+ pageTitle: any;
393
+ textblocks: any;
394
+ languageSupport: any;
395
+ };
396
+ dependencies: [(state: TState) => IApplicationContent, (_: TState, activatedLanguage: string) => string];
397
+ recomputations: () => number;
398
+ resetRecomputations: () => void;
399
+ dependencyRecomputations: () => number;
400
+ resetDependencyRecomputations: () => void;
401
+ } & {
402
+ memoize: typeof reselect.weakMapMemoize;
403
+ argsMemoize: typeof reselect.weakMapMemoize;
404
+ };
405
+ selectStepFromLanguageSupport: ((state: TState, activatedLanguage: string) => any[]) & {
406
+ clearCache: () => void;
407
+ resultsCount: () => number;
408
+ resetResultsCount: () => void;
409
+ } & {
410
+ resultFunc: (resultFuncArgs_0: IStepObject[], resultFuncArgs_1: string) => any[];
411
+ memoizedResultFunc: ((resultFuncArgs_0: IStepObject[], resultFuncArgs_1: string) => any[]) & {
412
+ clearCache: () => void;
413
+ resultsCount: () => number;
414
+ resetResultsCount: () => void;
415
+ };
416
+ lastResult: () => any[];
417
+ dependencies: [(state: TState) => IStepObject[], (_: TState, activatedLanguage: string) => string];
418
+ recomputations: () => number;
419
+ resetRecomputations: () => void;
420
+ dependencyRecomputations: () => number;
421
+ resetDependencyRecomputations: () => void;
422
+ } & {
423
+ memoize: typeof reselect.weakMapMemoize;
424
+ argsMemoize: typeof reselect.weakMapMemoize;
425
+ };
426
+ selectQuestionFromLanguageSupport: ((state: TState, activatedLanguage: string) => any[]) & {
427
+ clearCache: () => void;
428
+ resultsCount: () => number;
429
+ resetResultsCount: () => void;
430
+ } & {
431
+ resultFunc: (resultFuncArgs_0: IQuestion[], resultFuncArgs_1: string) => any[];
432
+ memoizedResultFunc: ((resultFuncArgs_0: IQuestion[], resultFuncArgs_1: string) => any[]) & {
433
+ clearCache: () => void;
434
+ resultsCount: () => number;
435
+ resetResultsCount: () => void;
436
+ };
437
+ lastResult: () => any[];
438
+ dependencies: [(state: TState) => IQuestion[], (_: TState, activatedLanguage: string) => string];
439
+ recomputations: () => number;
440
+ resetRecomputations: () => void;
441
+ dependencyRecomputations: () => number;
442
+ resetDependencyRecomputations: () => void;
443
+ } & {
444
+ memoize: typeof reselect.weakMapMemoize;
445
+ argsMemoize: typeof reselect.weakMapMemoize;
446
+ };
447
+ };
448
+
449
+ interface CookieConsentConfig {
450
+ cookieName: string;
451
+ choiceKey: string;
452
+ expiryYears?: number;
453
+ }
454
+ declare const createCookieConsent: (config: CookieConsentConfig) => {
455
+ acceptCookies: () => void;
456
+ rejectCookies: () => void;
457
+ areCookiesAccepted: () => boolean;
458
+ hasChoiceBeenMade: () => boolean;
459
+ clearChoiceFromSession: () => void;
460
+ };
461
+
312
462
  declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
313
463
 
314
464
  declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
@@ -415,4 +565,4 @@ interface CookieBannerProps {
415
565
 
416
566
  declare const CookieBanner: React.FC<CookieBannerProps>;
417
567
 
418
- export { AddFiles as AddFilesStandard, CookieBanner, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createLanguageSlice, makeLanguageSelectors };
568
+ export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createCookieConsent, createLanguageSlice, createQuestionsSlice, makeLanguageSelectors, makeQuestionsSelectors };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { FC } from 'react';
2
2
  import * as reselect from 'reselect';
3
3
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
- import { PayloadAction } from '@reduxjs/toolkit';
4
+ import { PayloadAction, ActionReducerMapBuilder } from '@reduxjs/toolkit';
5
5
  import * as immer from 'immer';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
@@ -309,6 +309,156 @@ declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => La
309
309
  };
310
310
  };
311
311
 
312
+ declare const createQuestionsSlice: (initialState: IFormState, options?: {
313
+ name?: string;
314
+ extraReducers?: (builder: ActionReducerMapBuilder<IFormState>) => void;
315
+ }) => _reduxjs_toolkit.Slice<IFormState, {
316
+ AddApplicationContentFromLanguageSupport: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
317
+ AddStepsFromLanguageSupport: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
318
+ AddQuestionsFromLanguageSupport: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
319
+ AddAnswer: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
320
+ AddFiles: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
321
+ RemoveAllQuestionsDisplayedInStep: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
322
+ AddQuestionDisplayed: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
323
+ RemoveAllAnswersForward: (state: immer.WritableDraft<IFormState>, action: PayloadAction<any>) => void;
324
+ }, string, string, _reduxjs_toolkit.SliceSelectors<IFormState>>;
325
+ declare const makeQuestionsSelectors: <TState>(selectSlice: (state: TState) => IFormState) => {
326
+ selectStateQuestion: (state: TState) => IFormState;
327
+ selectIsQuestionLoaded: (state: TState) => boolean;
328
+ selectApplicationContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
329
+ mainHeadline: string;
330
+ ingressBody: string;
331
+ linksForMoreInfo: never[];
332
+ pageTitle: string;
333
+ textblocks: never[];
334
+ languageSupport?: undefined;
335
+ } | {
336
+ mainHeadline: any;
337
+ ingressBody: any;
338
+ linksForMoreInfo: any;
339
+ pageTitle: any;
340
+ textblocks: any;
341
+ languageSupport: any;
342
+ }) & {
343
+ clearCache: () => void;
344
+ resultsCount: () => number;
345
+ resetResultsCount: () => void;
346
+ } & {
347
+ resultFunc: (resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
348
+ mainHeadline: string;
349
+ ingressBody: string;
350
+ linksForMoreInfo: never[];
351
+ pageTitle: string;
352
+ textblocks: never[];
353
+ languageSupport?: undefined;
354
+ } | {
355
+ mainHeadline: any;
356
+ ingressBody: any;
357
+ linksForMoreInfo: any;
358
+ pageTitle: any;
359
+ textblocks: any;
360
+ languageSupport: any;
361
+ };
362
+ memoizedResultFunc: ((resultFuncArgs_0: IApplicationContent, resultFuncArgs_1: string) => {
363
+ mainHeadline: string;
364
+ ingressBody: string;
365
+ linksForMoreInfo: never[];
366
+ pageTitle: string;
367
+ textblocks: never[];
368
+ languageSupport?: undefined;
369
+ } | {
370
+ mainHeadline: any;
371
+ ingressBody: any;
372
+ linksForMoreInfo: any;
373
+ pageTitle: any;
374
+ textblocks: any;
375
+ languageSupport: any;
376
+ }) & {
377
+ clearCache: () => void;
378
+ resultsCount: () => number;
379
+ resetResultsCount: () => void;
380
+ };
381
+ lastResult: () => {
382
+ mainHeadline: string;
383
+ ingressBody: string;
384
+ linksForMoreInfo: never[];
385
+ pageTitle: string;
386
+ textblocks: never[];
387
+ languageSupport?: undefined;
388
+ } | {
389
+ mainHeadline: any;
390
+ ingressBody: any;
391
+ linksForMoreInfo: any;
392
+ pageTitle: any;
393
+ textblocks: any;
394
+ languageSupport: any;
395
+ };
396
+ dependencies: [(state: TState) => IApplicationContent, (_: TState, activatedLanguage: string) => string];
397
+ recomputations: () => number;
398
+ resetRecomputations: () => void;
399
+ dependencyRecomputations: () => number;
400
+ resetDependencyRecomputations: () => void;
401
+ } & {
402
+ memoize: typeof reselect.weakMapMemoize;
403
+ argsMemoize: typeof reselect.weakMapMemoize;
404
+ };
405
+ selectStepFromLanguageSupport: ((state: TState, activatedLanguage: string) => any[]) & {
406
+ clearCache: () => void;
407
+ resultsCount: () => number;
408
+ resetResultsCount: () => void;
409
+ } & {
410
+ resultFunc: (resultFuncArgs_0: IStepObject[], resultFuncArgs_1: string) => any[];
411
+ memoizedResultFunc: ((resultFuncArgs_0: IStepObject[], resultFuncArgs_1: string) => any[]) & {
412
+ clearCache: () => void;
413
+ resultsCount: () => number;
414
+ resetResultsCount: () => void;
415
+ };
416
+ lastResult: () => any[];
417
+ dependencies: [(state: TState) => IStepObject[], (_: TState, activatedLanguage: string) => string];
418
+ recomputations: () => number;
419
+ resetRecomputations: () => void;
420
+ dependencyRecomputations: () => number;
421
+ resetDependencyRecomputations: () => void;
422
+ } & {
423
+ memoize: typeof reselect.weakMapMemoize;
424
+ argsMemoize: typeof reselect.weakMapMemoize;
425
+ };
426
+ selectQuestionFromLanguageSupport: ((state: TState, activatedLanguage: string) => any[]) & {
427
+ clearCache: () => void;
428
+ resultsCount: () => number;
429
+ resetResultsCount: () => void;
430
+ } & {
431
+ resultFunc: (resultFuncArgs_0: IQuestion[], resultFuncArgs_1: string) => any[];
432
+ memoizedResultFunc: ((resultFuncArgs_0: IQuestion[], resultFuncArgs_1: string) => any[]) & {
433
+ clearCache: () => void;
434
+ resultsCount: () => number;
435
+ resetResultsCount: () => void;
436
+ };
437
+ lastResult: () => any[];
438
+ dependencies: [(state: TState) => IQuestion[], (_: TState, activatedLanguage: string) => string];
439
+ recomputations: () => number;
440
+ resetRecomputations: () => void;
441
+ dependencyRecomputations: () => number;
442
+ resetDependencyRecomputations: () => void;
443
+ } & {
444
+ memoize: typeof reselect.weakMapMemoize;
445
+ argsMemoize: typeof reselect.weakMapMemoize;
446
+ };
447
+ };
448
+
449
+ interface CookieConsentConfig {
450
+ cookieName: string;
451
+ choiceKey: string;
452
+ expiryYears?: number;
453
+ }
454
+ declare const createCookieConsent: (config: CookieConsentConfig) => {
455
+ acceptCookies: () => void;
456
+ rejectCookies: () => void;
457
+ areCookiesAccepted: () => boolean;
458
+ hasChoiceBeenMade: () => boolean;
459
+ clearChoiceFromSession: () => void;
460
+ };
461
+
312
462
  declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
313
463
 
314
464
  declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
@@ -415,4 +565,4 @@ interface CookieBannerProps {
415
565
 
416
566
  declare const CookieBanner: React.FC<CookieBannerProps>;
417
567
 
418
- export { AddFiles as AddFilesStandard, CookieBanner, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createLanguageSlice, makeLanguageSelectors };
568
+ export { AddFiles as AddFilesStandard, CookieBanner, type CookieConsentConfig, CreateApiDataObject, doCategoriesAndQuestionsVisible as DoCategoriesAndQuestionsVisible, EditPreviewLink as EditPreviewLinkStandard, FilesUpload as FilesUploadStandard, Footer as FooterStandard, groupQuestionByStepPreviewPage as GroupQuestionByStepPreviewPage, groupQuestionsByStepCategoryGroup as GroupQuestionsByStepCategoryGroup, Header as HeaderStandard, type IApplicationContent, type IFormState, type ILanguage, type ILanguageSupport, ILanguageSupportinitialState, type IOption, type IPTSLink, type IQuestion, type IQuestionExtraAttribute, type IStepObject, type IStepQuestionData, type ITextBlock, InfoOnly as InfoOnlyStandard, isDependsOnOtherQuestionTrue as IsDependsOnOtherQuestionTrue, type LanguageSupportConfig, Modal as ModalStandard, MultipleCheckboxes as MultipleCheckboxesStandard, PrincipleOfPublicity as PrincipleOfPublicityStandard, questionHasValidationError as QuestionHasValidationError, QuestioninitialState, InputRadio as RadioMultipleStandard, RenderQuestion, RenderQuestionGroup, ServiceHeadlineAndBody as ServiceHeadlineAndBodyStandard, SkipLink as SkipLinkStandard, StepperButtons as StepperButtonsStandard, Stepper as StepperStandard, InputTextarea as TextAreaStandard, TextFieldStandard, TextHeadlineAndBody as TextHeadlineAndBodyStandard, validationCheckAllVisibleQuestions as ValidationCheckAllVisibleQuestion, ValidationErrorSummaryList, createCookieConsent, createLanguageSlice, createQuestionsSlice, makeLanguageSelectors, makeQuestionsSelectors };
package/dist/index.js CHANGED
@@ -60,8 +60,11 @@ __export(index_exports, {
60
60
  TextHeadlineAndBodyStandard: () => TextHeadlineAndBodyStandard_default,
61
61
  ValidationCheckAllVisibleQuestion: () => ValidationCheckAllVisibleQuestion_default,
62
62
  ValidationErrorSummaryList: () => ValidationErrorSummaryList_default,
63
+ createCookieConsent: () => createCookieConsent,
63
64
  createLanguageSlice: () => createLanguageSlice,
64
- makeLanguageSelectors: () => makeLanguageSelectors
65
+ createQuestionsSlice: () => createQuestionsSlice,
66
+ makeLanguageSelectors: () => makeLanguageSelectors,
67
+ makeQuestionsSelectors: () => makeQuestionsSelectors
65
68
  });
66
69
  module.exports = __toCommonJS(index_exports);
67
70
 
@@ -1636,6 +1639,232 @@ var makeLanguageSelectors = (selectSlice) => {
1636
1639
  };
1637
1640
  };
1638
1641
 
1642
+ // src/NewHelpMethodsStandard/QuestionSlice/questionSlice.ts
1643
+ var import_toolkit2 = require("@reduxjs/toolkit");
1644
+ var createQuestionsSlice = (initialState, options) => {
1645
+ var _a;
1646
+ const slice = (0, import_toolkit2.createSlice)({
1647
+ name: (_a = options == null ? void 0 : options.name) != null ? _a : "Form",
1648
+ initialState,
1649
+ reducers: {
1650
+ AddApplicationContentFromLanguageSupport: (state, action) => {
1651
+ state.applicationContent = action.payload;
1652
+ state.questionsLoaded = true;
1653
+ },
1654
+ AddStepsFromLanguageSupport: (state, action) => {
1655
+ state.steps = action.payload;
1656
+ },
1657
+ AddQuestionsFromLanguageSupport: (state, action) => {
1658
+ state.questions = action.payload;
1659
+ },
1660
+ AddAnswer: (state, action) => {
1661
+ state.questions = state.questions.map((qObject) => {
1662
+ if (qObject.id === action.payload.id) {
1663
+ return {
1664
+ ...qObject,
1665
+ answer: action.payload.answer
1666
+ };
1667
+ }
1668
+ return qObject;
1669
+ });
1670
+ },
1671
+ AddFiles: (state, action) => {
1672
+ state.questions = state.questions.map((qObject) => {
1673
+ if (qObject.id === action.payload.id) {
1674
+ return {
1675
+ ...qObject,
1676
+ files: action.payload.files
1677
+ };
1678
+ }
1679
+ return qObject;
1680
+ });
1681
+ },
1682
+ RemoveAllQuestionsDisplayedInStep: (state, action) => {
1683
+ const { activeStep } = action.payload;
1684
+ state.questions = state.questions.map((qObject) => {
1685
+ if (qObject.step >= activeStep) {
1686
+ return {
1687
+ ...qObject,
1688
+ isDisplayed: false
1689
+ };
1690
+ }
1691
+ return qObject;
1692
+ });
1693
+ },
1694
+ AddQuestionDisplayed: (state, action) => {
1695
+ state.questions = state.questions.map((qObject) => {
1696
+ if (qObject.id === action.payload.id) {
1697
+ return {
1698
+ ...qObject,
1699
+ isDisplayed: action.payload.isDisplayed
1700
+ };
1701
+ }
1702
+ return qObject;
1703
+ });
1704
+ },
1705
+ RemoveAllAnswersForward: (state, action) => {
1706
+ state.questions = state.questions.map((qObject) => {
1707
+ let questionExistInLinkedToQuestion = false;
1708
+ if (qObject.dependsOnOtherQuestion !== void 0) {
1709
+ questionExistInLinkedToQuestion = qObject.dependsOnOtherQuestion.some(
1710
+ (innerArray) => innerArray.some((item) => item.LinkedToQuestionId === action.payload.id)
1711
+ );
1712
+ }
1713
+ const shouldClear = qObject.id > action.payload.id && !qObject.isDisplayed && qObject.dependsOnOtherQuestion !== void 0 && questionExistInLinkedToQuestion;
1714
+ if (shouldClear) {
1715
+ return {
1716
+ ...qObject,
1717
+ answer: ""
1718
+ };
1719
+ }
1720
+ return qObject;
1721
+ });
1722
+ }
1723
+ },
1724
+ extraReducers: (builder) => {
1725
+ if (options == null ? void 0 : options.extraReducers) {
1726
+ options.extraReducers(builder);
1727
+ }
1728
+ }
1729
+ });
1730
+ return slice;
1731
+ };
1732
+ var makeQuestionsSelectors = (selectSlice) => {
1733
+ const selectStateQuestion = (state) => selectSlice(state);
1734
+ const selectIsQuestionLoaded = (state) => selectSlice(state).questionsLoaded;
1735
+ const selectApplicationContentFromLanguageSupport = (0, import_toolkit2.createSelector)(
1736
+ [
1737
+ (state) => selectSlice(state).applicationContent,
1738
+ (_, activatedLanguage) => activatedLanguage
1739
+ ],
1740
+ (applicationContent, activatedLanguage) => {
1741
+ var _a;
1742
+ const languageSupport = (_a = applicationContent == null ? void 0 : applicationContent.languageSupport) == null ? void 0 : _a.find(
1743
+ (lang) => lang.language === activatedLanguage
1744
+ );
1745
+ if (!languageSupport) {
1746
+ return {
1747
+ mainHeadline: "",
1748
+ ingressBody: "",
1749
+ linksForMoreInfo: [],
1750
+ pageTitle: "",
1751
+ textblocks: []
1752
+ };
1753
+ }
1754
+ return {
1755
+ mainHeadline: languageSupport.mainHeadline,
1756
+ ingressBody: languageSupport.ingressBody,
1757
+ linksForMoreInfo: languageSupport.linksForMoreInfo,
1758
+ pageTitle: languageSupport.pageTitle,
1759
+ textblocks: languageSupport.textblocks,
1760
+ languageSupport: applicationContent == null ? void 0 : applicationContent.languageSupport
1761
+ };
1762
+ }
1763
+ );
1764
+ const selectStepFromLanguageSupport = (0, import_toolkit2.createSelector)(
1765
+ [
1766
+ (state) => selectSlice(state).steps,
1767
+ (_, activatedLanguage) => activatedLanguage
1768
+ ],
1769
+ (steps, activatedLanguage) => {
1770
+ return steps.map((stepperObject) => {
1771
+ let languageSupport = stepperObject.languageSupport.find(
1772
+ (lang) => lang.language === activatedLanguage
1773
+ );
1774
+ if (!languageSupport) {
1775
+ languageSupport = {};
1776
+ }
1777
+ return {
1778
+ ...stepperObject,
1779
+ stepHeadline: languageSupport.stepHeadline,
1780
+ stepDescription: languageSupport.stepDescription,
1781
+ shortNameInStepper: languageSupport.shortNameInStepper,
1782
+ shortNameInPreview: languageSupport.shortNameInPreview,
1783
+ pageTitle: languageSupport.pageTitle
1784
+ };
1785
+ });
1786
+ }
1787
+ );
1788
+ const selectQuestionFromLanguageSupport = (0, import_toolkit2.createSelector)(
1789
+ [
1790
+ (state) => selectSlice(state).questions,
1791
+ (_, activatedLanguage) => activatedLanguage
1792
+ ],
1793
+ (questions, activatedLanguage) => {
1794
+ return questions.map((qObject) => {
1795
+ let languageSupport = qObject.languageSupport.find(
1796
+ (lang) => lang.language === activatedLanguage
1797
+ );
1798
+ if (!languageSupport) {
1799
+ languageSupport = {};
1800
+ }
1801
+ return {
1802
+ ...qObject,
1803
+ categoryLabel: languageSupport.categoryLabel,
1804
+ categoryDescription: languageSupport.categoryDescription,
1805
+ questionLabel: languageSupport.questionLabel,
1806
+ previewLabel: languageSupport.previewLabel,
1807
+ aboutText: languageSupport.aboutText,
1808
+ options: languageSupport.options,
1809
+ validationDefaultMessesege: languageSupport.validationDefaultMessesege,
1810
+ validationSummaryLabel: languageSupport.validationSummaryLabel
1811
+ };
1812
+ });
1813
+ }
1814
+ );
1815
+ return {
1816
+ selectStateQuestion,
1817
+ selectIsQuestionLoaded,
1818
+ selectApplicationContentFromLanguageSupport,
1819
+ selectStepFromLanguageSupport,
1820
+ selectQuestionFromLanguageSupport
1821
+ };
1822
+ };
1823
+
1824
+ // src/NewHelpMethodsStandard/CookieHandler/cookieHandler.ts
1825
+ var getCookie = (name) => {
1826
+ const match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
1827
+ return match ? match[2] : null;
1828
+ };
1829
+ var setCookie = (name, value, expirationDate) => {
1830
+ let cookieString = `${name}=${value}; path=/; SameSite=Strict`;
1831
+ if (expirationDate) {
1832
+ cookieString += `; expires=${expirationDate.toUTCString()}`;
1833
+ }
1834
+ if (window.location.protocol === "https:") {
1835
+ cookieString += "; Secure";
1836
+ }
1837
+ document.cookie = cookieString;
1838
+ };
1839
+ var removeCookie = (name) => {
1840
+ const pastDate = /* @__PURE__ */ new Date(0);
1841
+ setCookie(name, "", pastDate);
1842
+ };
1843
+ var createCookieConsent = (config) => {
1844
+ const { cookieName, choiceKey, expiryYears = 1 } = config;
1845
+ const acceptCookies = () => {
1846
+ const expires = /* @__PURE__ */ new Date();
1847
+ expires.setFullYear(expires.getFullYear() + expiryYears);
1848
+ setCookie(cookieName, "true", expires);
1849
+ localStorage.setItem(cookieName, "true");
1850
+ };
1851
+ const rejectCookies = () => {
1852
+ removeCookie(cookieName);
1853
+ localStorage.removeItem(cookieName);
1854
+ sessionStorage.setItem(choiceKey, "true");
1855
+ };
1856
+ const areCookiesAccepted = () => getCookie(cookieName) === "true";
1857
+ const hasChoiceBeenMade = () => sessionStorage.getItem(choiceKey) === "true";
1858
+ const clearChoiceFromSession = () => sessionStorage.removeItem(choiceKey);
1859
+ return {
1860
+ acceptCookies,
1861
+ rejectCookies,
1862
+ areCookiesAccepted,
1863
+ hasChoiceBeenMade,
1864
+ clearChoiceFromSession
1865
+ };
1866
+ };
1867
+
1639
1868
  // src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
1640
1869
  var import_jsx_runtime12 = require("react/jsx-runtime");
1641
1870
  var RenderQuestion = ({
@@ -2926,6 +3155,9 @@ var CookieBanner_default = CookieBanner;
2926
3155
  TextHeadlineAndBodyStandard,
2927
3156
  ValidationCheckAllVisibleQuestion,
2928
3157
  ValidationErrorSummaryList,
3158
+ createCookieConsent,
2929
3159
  createLanguageSlice,
2930
- makeLanguageSelectors
3160
+ createQuestionsSlice,
3161
+ makeLanguageSelectors,
3162
+ makeQuestionsSelectors
2931
3163
  });
package/dist/index.mjs CHANGED
@@ -1569,6 +1569,235 @@ var makeLanguageSelectors = (selectSlice) => {
1569
1569
  };
1570
1570
  };
1571
1571
 
1572
+ // src/NewHelpMethodsStandard/QuestionSlice/questionSlice.ts
1573
+ import {
1574
+ createSlice as createSlice2,
1575
+ createSelector as createSelector2
1576
+ } from "@reduxjs/toolkit";
1577
+ var createQuestionsSlice = (initialState, options) => {
1578
+ var _a;
1579
+ const slice = createSlice2({
1580
+ name: (_a = options == null ? void 0 : options.name) != null ? _a : "Form",
1581
+ initialState,
1582
+ reducers: {
1583
+ AddApplicationContentFromLanguageSupport: (state, action) => {
1584
+ state.applicationContent = action.payload;
1585
+ state.questionsLoaded = true;
1586
+ },
1587
+ AddStepsFromLanguageSupport: (state, action) => {
1588
+ state.steps = action.payload;
1589
+ },
1590
+ AddQuestionsFromLanguageSupport: (state, action) => {
1591
+ state.questions = action.payload;
1592
+ },
1593
+ AddAnswer: (state, action) => {
1594
+ state.questions = state.questions.map((qObject) => {
1595
+ if (qObject.id === action.payload.id) {
1596
+ return {
1597
+ ...qObject,
1598
+ answer: action.payload.answer
1599
+ };
1600
+ }
1601
+ return qObject;
1602
+ });
1603
+ },
1604
+ AddFiles: (state, action) => {
1605
+ state.questions = state.questions.map((qObject) => {
1606
+ if (qObject.id === action.payload.id) {
1607
+ return {
1608
+ ...qObject,
1609
+ files: action.payload.files
1610
+ };
1611
+ }
1612
+ return qObject;
1613
+ });
1614
+ },
1615
+ RemoveAllQuestionsDisplayedInStep: (state, action) => {
1616
+ const { activeStep } = action.payload;
1617
+ state.questions = state.questions.map((qObject) => {
1618
+ if (qObject.step >= activeStep) {
1619
+ return {
1620
+ ...qObject,
1621
+ isDisplayed: false
1622
+ };
1623
+ }
1624
+ return qObject;
1625
+ });
1626
+ },
1627
+ AddQuestionDisplayed: (state, action) => {
1628
+ state.questions = state.questions.map((qObject) => {
1629
+ if (qObject.id === action.payload.id) {
1630
+ return {
1631
+ ...qObject,
1632
+ isDisplayed: action.payload.isDisplayed
1633
+ };
1634
+ }
1635
+ return qObject;
1636
+ });
1637
+ },
1638
+ RemoveAllAnswersForward: (state, action) => {
1639
+ state.questions = state.questions.map((qObject) => {
1640
+ let questionExistInLinkedToQuestion = false;
1641
+ if (qObject.dependsOnOtherQuestion !== void 0) {
1642
+ questionExistInLinkedToQuestion = qObject.dependsOnOtherQuestion.some(
1643
+ (innerArray) => innerArray.some((item) => item.LinkedToQuestionId === action.payload.id)
1644
+ );
1645
+ }
1646
+ const shouldClear = qObject.id > action.payload.id && !qObject.isDisplayed && qObject.dependsOnOtherQuestion !== void 0 && questionExistInLinkedToQuestion;
1647
+ if (shouldClear) {
1648
+ return {
1649
+ ...qObject,
1650
+ answer: ""
1651
+ };
1652
+ }
1653
+ return qObject;
1654
+ });
1655
+ }
1656
+ },
1657
+ extraReducers: (builder) => {
1658
+ if (options == null ? void 0 : options.extraReducers) {
1659
+ options.extraReducers(builder);
1660
+ }
1661
+ }
1662
+ });
1663
+ return slice;
1664
+ };
1665
+ var makeQuestionsSelectors = (selectSlice) => {
1666
+ const selectStateQuestion = (state) => selectSlice(state);
1667
+ const selectIsQuestionLoaded = (state) => selectSlice(state).questionsLoaded;
1668
+ const selectApplicationContentFromLanguageSupport = createSelector2(
1669
+ [
1670
+ (state) => selectSlice(state).applicationContent,
1671
+ (_, activatedLanguage) => activatedLanguage
1672
+ ],
1673
+ (applicationContent, activatedLanguage) => {
1674
+ var _a;
1675
+ const languageSupport = (_a = applicationContent == null ? void 0 : applicationContent.languageSupport) == null ? void 0 : _a.find(
1676
+ (lang) => lang.language === activatedLanguage
1677
+ );
1678
+ if (!languageSupport) {
1679
+ return {
1680
+ mainHeadline: "",
1681
+ ingressBody: "",
1682
+ linksForMoreInfo: [],
1683
+ pageTitle: "",
1684
+ textblocks: []
1685
+ };
1686
+ }
1687
+ return {
1688
+ mainHeadline: languageSupport.mainHeadline,
1689
+ ingressBody: languageSupport.ingressBody,
1690
+ linksForMoreInfo: languageSupport.linksForMoreInfo,
1691
+ pageTitle: languageSupport.pageTitle,
1692
+ textblocks: languageSupport.textblocks,
1693
+ languageSupport: applicationContent == null ? void 0 : applicationContent.languageSupport
1694
+ };
1695
+ }
1696
+ );
1697
+ const selectStepFromLanguageSupport = createSelector2(
1698
+ [
1699
+ (state) => selectSlice(state).steps,
1700
+ (_, activatedLanguage) => activatedLanguage
1701
+ ],
1702
+ (steps, activatedLanguage) => {
1703
+ return steps.map((stepperObject) => {
1704
+ let languageSupport = stepperObject.languageSupport.find(
1705
+ (lang) => lang.language === activatedLanguage
1706
+ );
1707
+ if (!languageSupport) {
1708
+ languageSupport = {};
1709
+ }
1710
+ return {
1711
+ ...stepperObject,
1712
+ stepHeadline: languageSupport.stepHeadline,
1713
+ stepDescription: languageSupport.stepDescription,
1714
+ shortNameInStepper: languageSupport.shortNameInStepper,
1715
+ shortNameInPreview: languageSupport.shortNameInPreview,
1716
+ pageTitle: languageSupport.pageTitle
1717
+ };
1718
+ });
1719
+ }
1720
+ );
1721
+ const selectQuestionFromLanguageSupport = createSelector2(
1722
+ [
1723
+ (state) => selectSlice(state).questions,
1724
+ (_, activatedLanguage) => activatedLanguage
1725
+ ],
1726
+ (questions, activatedLanguage) => {
1727
+ return questions.map((qObject) => {
1728
+ let languageSupport = qObject.languageSupport.find(
1729
+ (lang) => lang.language === activatedLanguage
1730
+ );
1731
+ if (!languageSupport) {
1732
+ languageSupport = {};
1733
+ }
1734
+ return {
1735
+ ...qObject,
1736
+ categoryLabel: languageSupport.categoryLabel,
1737
+ categoryDescription: languageSupport.categoryDescription,
1738
+ questionLabel: languageSupport.questionLabel,
1739
+ previewLabel: languageSupport.previewLabel,
1740
+ aboutText: languageSupport.aboutText,
1741
+ options: languageSupport.options,
1742
+ validationDefaultMessesege: languageSupport.validationDefaultMessesege,
1743
+ validationSummaryLabel: languageSupport.validationSummaryLabel
1744
+ };
1745
+ });
1746
+ }
1747
+ );
1748
+ return {
1749
+ selectStateQuestion,
1750
+ selectIsQuestionLoaded,
1751
+ selectApplicationContentFromLanguageSupport,
1752
+ selectStepFromLanguageSupport,
1753
+ selectQuestionFromLanguageSupport
1754
+ };
1755
+ };
1756
+
1757
+ // src/NewHelpMethodsStandard/CookieHandler/cookieHandler.ts
1758
+ var getCookie = (name) => {
1759
+ const match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
1760
+ return match ? match[2] : null;
1761
+ };
1762
+ var setCookie = (name, value, expirationDate) => {
1763
+ let cookieString = `${name}=${value}; path=/; SameSite=Strict`;
1764
+ if (expirationDate) {
1765
+ cookieString += `; expires=${expirationDate.toUTCString()}`;
1766
+ }
1767
+ if (window.location.protocol === "https:") {
1768
+ cookieString += "; Secure";
1769
+ }
1770
+ document.cookie = cookieString;
1771
+ };
1772
+ var removeCookie = (name) => {
1773
+ const pastDate = /* @__PURE__ */ new Date(0);
1774
+ setCookie(name, "", pastDate);
1775
+ };
1776
+ var createCookieConsent = (config) => {
1777
+ const { cookieName, choiceKey, expiryYears = 1 } = config;
1778
+ const acceptCookies = () => {
1779
+ const expires = /* @__PURE__ */ new Date();
1780
+ expires.setFullYear(expires.getFullYear() + expiryYears);
1781
+ setCookie(cookieName, "true", expires);
1782
+ localStorage.setItem(cookieName, "true");
1783
+ };
1784
+ const rejectCookies = () => {
1785
+ removeCookie(cookieName);
1786
+ localStorage.removeItem(cookieName);
1787
+ sessionStorage.setItem(choiceKey, "true");
1788
+ };
1789
+ const areCookiesAccepted = () => getCookie(cookieName) === "true";
1790
+ const hasChoiceBeenMade = () => sessionStorage.getItem(choiceKey) === "true";
1791
+ const clearChoiceFromSession = () => sessionStorage.removeItem(choiceKey);
1792
+ return {
1793
+ acceptCookies,
1794
+ rejectCookies,
1795
+ areCookiesAccepted,
1796
+ hasChoiceBeenMade,
1797
+ clearChoiceFromSession
1798
+ };
1799
+ };
1800
+
1572
1801
  // src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
1573
1802
  import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1574
1803
  var RenderQuestion = ({
@@ -2858,6 +3087,9 @@ export {
2858
3087
  TextHeadlineAndBodyStandard_default as TextHeadlineAndBodyStandard,
2859
3088
  ValidationCheckAllVisibleQuestion_default as ValidationCheckAllVisibleQuestion,
2860
3089
  ValidationErrorSummaryList_default as ValidationErrorSummaryList,
3090
+ createCookieConsent,
2861
3091
  createLanguageSlice,
2862
- makeLanguageSelectors
3092
+ createQuestionsSlice,
3093
+ makeLanguageSelectors,
3094
+ makeQuestionsSelectors
2863
3095
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "optimized-react-component-library-xyz123",
3
- "version": "0.1.93",
3
+ "version": "0.1.95",
4
4
  "description": "A modern React component library using TypeScript with React 19 support.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",