optimized-react-component-library-xyz123 0.1.90 → 0.1.91
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 +89 -1
- package/dist/index.d.ts +89 -1
- package/dist/index.js +86 -2
- package/dist/index.mjs +83 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
import * as reselect from 'reselect';
|
|
3
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
5
|
+
import * as immer from 'immer';
|
|
2
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
7
|
|
|
4
8
|
interface IApplicationContent {
|
|
@@ -221,6 +225,90 @@ declare function validationCheckAllVisibleQuestions(data: any, formQuestion: any
|
|
|
221
225
|
|
|
222
226
|
declare function groupQuestionsByStepCategoryGroup(questions: IQuestion[], steps: IStepObject[], validationErrorsList: number[]): any[];
|
|
223
227
|
|
|
228
|
+
/** ----- Typer ----- */
|
|
229
|
+
interface LanguageEntry {
|
|
230
|
+
language: string;
|
|
231
|
+
backButton: string;
|
|
232
|
+
forwardButton: string;
|
|
233
|
+
sendButton: string;
|
|
234
|
+
}
|
|
235
|
+
interface LanguageSupportConfig {
|
|
236
|
+
activatedLanguage: string;
|
|
237
|
+
languageSupport: LanguageEntry[];
|
|
238
|
+
}
|
|
239
|
+
interface LanguageState {
|
|
240
|
+
activatedLanguage: string;
|
|
241
|
+
languageSupport: LanguageEntry[];
|
|
242
|
+
languageSupportLoaded: boolean;
|
|
243
|
+
backButton: string;
|
|
244
|
+
forwardButton: string;
|
|
245
|
+
sendButton: string;
|
|
246
|
+
}
|
|
247
|
+
/** ----- Slice-fabrik (ingen app-specifik state/RootState här) ----- */
|
|
248
|
+
declare const createLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
249
|
+
name?: string;
|
|
250
|
+
}) => _reduxjs_toolkit.Slice<LanguageState, {
|
|
251
|
+
setActivatedLanguage: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<string>) => void;
|
|
252
|
+
setLabelsFromLanguageEntry: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<Pick<LanguageEntry, "backButton" | "forwardButton" | "sendButton">>) => void;
|
|
253
|
+
replaceLanguageSupport: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
|
|
254
|
+
}, string, string, _reduxjs_toolkit.SliceSelectors<LanguageState>>;
|
|
255
|
+
/** ----- Selector-fabrik (helt generisk, ingen RootState) ----- */
|
|
256
|
+
declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
|
|
257
|
+
selectActivatedLanguage: (state: TState) => string;
|
|
258
|
+
selectLanguageSupportLoaded: (state: TState) => boolean;
|
|
259
|
+
selectLanguageSupport: (state: TState) => LanguageEntry[];
|
|
260
|
+
selectOverallContentState: (state: TState) => LanguageState;
|
|
261
|
+
selectOverallContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
|
|
262
|
+
activatedLanguage: string;
|
|
263
|
+
languageSupport: LanguageEntry[];
|
|
264
|
+
languageSupportLoaded: boolean;
|
|
265
|
+
backButton: string;
|
|
266
|
+
forwardButton: string;
|
|
267
|
+
sendButton: string;
|
|
268
|
+
}) & {
|
|
269
|
+
clearCache: () => void;
|
|
270
|
+
resultsCount: () => number;
|
|
271
|
+
resetResultsCount: () => void;
|
|
272
|
+
} & {
|
|
273
|
+
resultFunc: (resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
|
|
274
|
+
activatedLanguage: string;
|
|
275
|
+
languageSupport: LanguageEntry[];
|
|
276
|
+
languageSupportLoaded: boolean;
|
|
277
|
+
backButton: string;
|
|
278
|
+
forwardButton: string;
|
|
279
|
+
sendButton: string;
|
|
280
|
+
};
|
|
281
|
+
memoizedResultFunc: ((resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
|
|
282
|
+
activatedLanguage: string;
|
|
283
|
+
languageSupport: LanguageEntry[];
|
|
284
|
+
languageSupportLoaded: boolean;
|
|
285
|
+
backButton: string;
|
|
286
|
+
forwardButton: string;
|
|
287
|
+
sendButton: string;
|
|
288
|
+
}) & {
|
|
289
|
+
clearCache: () => void;
|
|
290
|
+
resultsCount: () => number;
|
|
291
|
+
resetResultsCount: () => void;
|
|
292
|
+
};
|
|
293
|
+
lastResult: () => {
|
|
294
|
+
activatedLanguage: string;
|
|
295
|
+
languageSupport: LanguageEntry[];
|
|
296
|
+
languageSupportLoaded: boolean;
|
|
297
|
+
backButton: string;
|
|
298
|
+
forwardButton: string;
|
|
299
|
+
sendButton: string;
|
|
300
|
+
};
|
|
301
|
+
dependencies: [(state: TState) => LanguageState, (_: TState, activatedLanguage: string) => string];
|
|
302
|
+
recomputations: () => number;
|
|
303
|
+
resetRecomputations: () => void;
|
|
304
|
+
dependencyRecomputations: () => number;
|
|
305
|
+
resetDependencyRecomputations: () => void;
|
|
306
|
+
} & {
|
|
307
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
308
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
|
|
224
312
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
225
313
|
|
|
226
314
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -327,4 +415,4 @@ interface CookieBannerProps {
|
|
|
327
415
|
|
|
328
416
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
329
417
|
|
|
330
|
-
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, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
import * as reselect from 'reselect';
|
|
3
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
5
|
+
import * as immer from 'immer';
|
|
2
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
7
|
|
|
4
8
|
interface IApplicationContent {
|
|
@@ -221,6 +225,90 @@ declare function validationCheckAllVisibleQuestions(data: any, formQuestion: any
|
|
|
221
225
|
|
|
222
226
|
declare function groupQuestionsByStepCategoryGroup(questions: IQuestion[], steps: IStepObject[], validationErrorsList: number[]): any[];
|
|
223
227
|
|
|
228
|
+
/** ----- Typer ----- */
|
|
229
|
+
interface LanguageEntry {
|
|
230
|
+
language: string;
|
|
231
|
+
backButton: string;
|
|
232
|
+
forwardButton: string;
|
|
233
|
+
sendButton: string;
|
|
234
|
+
}
|
|
235
|
+
interface LanguageSupportConfig {
|
|
236
|
+
activatedLanguage: string;
|
|
237
|
+
languageSupport: LanguageEntry[];
|
|
238
|
+
}
|
|
239
|
+
interface LanguageState {
|
|
240
|
+
activatedLanguage: string;
|
|
241
|
+
languageSupport: LanguageEntry[];
|
|
242
|
+
languageSupportLoaded: boolean;
|
|
243
|
+
backButton: string;
|
|
244
|
+
forwardButton: string;
|
|
245
|
+
sendButton: string;
|
|
246
|
+
}
|
|
247
|
+
/** ----- Slice-fabrik (ingen app-specifik state/RootState här) ----- */
|
|
248
|
+
declare const createLanguageSlice: (initialConfig: LanguageSupportConfig, options?: {
|
|
249
|
+
name?: string;
|
|
250
|
+
}) => _reduxjs_toolkit.Slice<LanguageState, {
|
|
251
|
+
setActivatedLanguage: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<string>) => void;
|
|
252
|
+
setLabelsFromLanguageEntry: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<Pick<LanguageEntry, "backButton" | "forwardButton" | "sendButton">>) => void;
|
|
253
|
+
replaceLanguageSupport: (state: immer.WritableDraft<LanguageState>, action: PayloadAction<LanguageSupportConfig>) => void;
|
|
254
|
+
}, string, string, _reduxjs_toolkit.SliceSelectors<LanguageState>>;
|
|
255
|
+
/** ----- Selector-fabrik (helt generisk, ingen RootState) ----- */
|
|
256
|
+
declare const makeLanguageSelectors: <TState>(selectSlice: (state: TState) => LanguageState) => {
|
|
257
|
+
selectActivatedLanguage: (state: TState) => string;
|
|
258
|
+
selectLanguageSupportLoaded: (state: TState) => boolean;
|
|
259
|
+
selectLanguageSupport: (state: TState) => LanguageEntry[];
|
|
260
|
+
selectOverallContentState: (state: TState) => LanguageState;
|
|
261
|
+
selectOverallContentFromLanguageSupport: ((state: TState, activatedLanguage: string) => {
|
|
262
|
+
activatedLanguage: string;
|
|
263
|
+
languageSupport: LanguageEntry[];
|
|
264
|
+
languageSupportLoaded: boolean;
|
|
265
|
+
backButton: string;
|
|
266
|
+
forwardButton: string;
|
|
267
|
+
sendButton: string;
|
|
268
|
+
}) & {
|
|
269
|
+
clearCache: () => void;
|
|
270
|
+
resultsCount: () => number;
|
|
271
|
+
resetResultsCount: () => void;
|
|
272
|
+
} & {
|
|
273
|
+
resultFunc: (resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
|
|
274
|
+
activatedLanguage: string;
|
|
275
|
+
languageSupport: LanguageEntry[];
|
|
276
|
+
languageSupportLoaded: boolean;
|
|
277
|
+
backButton: string;
|
|
278
|
+
forwardButton: string;
|
|
279
|
+
sendButton: string;
|
|
280
|
+
};
|
|
281
|
+
memoizedResultFunc: ((resultFuncArgs_0: LanguageState, resultFuncArgs_1: string) => {
|
|
282
|
+
activatedLanguage: string;
|
|
283
|
+
languageSupport: LanguageEntry[];
|
|
284
|
+
languageSupportLoaded: boolean;
|
|
285
|
+
backButton: string;
|
|
286
|
+
forwardButton: string;
|
|
287
|
+
sendButton: string;
|
|
288
|
+
}) & {
|
|
289
|
+
clearCache: () => void;
|
|
290
|
+
resultsCount: () => number;
|
|
291
|
+
resetResultsCount: () => void;
|
|
292
|
+
};
|
|
293
|
+
lastResult: () => {
|
|
294
|
+
activatedLanguage: string;
|
|
295
|
+
languageSupport: LanguageEntry[];
|
|
296
|
+
languageSupportLoaded: boolean;
|
|
297
|
+
backButton: string;
|
|
298
|
+
forwardButton: string;
|
|
299
|
+
sendButton: string;
|
|
300
|
+
};
|
|
301
|
+
dependencies: [(state: TState) => LanguageState, (_: TState, activatedLanguage: string) => string];
|
|
302
|
+
recomputations: () => number;
|
|
303
|
+
resetRecomputations: () => void;
|
|
304
|
+
dependencyRecomputations: () => number;
|
|
305
|
+
resetDependencyRecomputations: () => void;
|
|
306
|
+
} & {
|
|
307
|
+
memoize: typeof reselect.weakMapMemoize;
|
|
308
|
+
argsMemoize: typeof reselect.weakMapMemoize;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
|
|
224
312
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
225
313
|
|
|
226
314
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -327,4 +415,4 @@ interface CookieBannerProps {
|
|
|
327
415
|
|
|
328
416
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
329
417
|
|
|
330
|
-
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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,9 @@ __export(index_exports, {
|
|
|
59
59
|
TextFieldStandard: () => TextFieldStandard_default,
|
|
60
60
|
TextHeadlineAndBodyStandard: () => TextHeadlineAndBodyStandard_default,
|
|
61
61
|
ValidationCheckAllVisibleQuestion: () => ValidationCheckAllVisibleQuestion_default,
|
|
62
|
-
ValidationErrorSummaryList: () => ValidationErrorSummaryList_default
|
|
62
|
+
ValidationErrorSummaryList: () => ValidationErrorSummaryList_default,
|
|
63
|
+
createLanguageSlice: () => createLanguageSlice,
|
|
64
|
+
makeLanguageSelectors: () => makeLanguageSelectors
|
|
63
65
|
});
|
|
64
66
|
module.exports = __toCommonJS(index_exports);
|
|
65
67
|
|
|
@@ -1554,6 +1556,86 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
|
|
|
1554
1556
|
}
|
|
1555
1557
|
var GroupQuestionsByStepCategoryGroup_default = groupQuestionsByStepCategoryGroup;
|
|
1556
1558
|
|
|
1559
|
+
// src/NewHelpMethodsStandard/ApplicationContentSlice/applicationContentSlice.ts
|
|
1560
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
1561
|
+
var pickLang = (cfg, lang) => {
|
|
1562
|
+
var _a;
|
|
1563
|
+
return (_a = cfg.languageSupport.find((l) => l.language === lang)) != null ? _a : cfg.languageSupport[0];
|
|
1564
|
+
};
|
|
1565
|
+
var createLanguageSlice = (initialConfig, options) => {
|
|
1566
|
+
var _a;
|
|
1567
|
+
const name = (_a = options == null ? void 0 : options.name) != null ? _a : "applicationContent";
|
|
1568
|
+
const initialLang = pickLang(initialConfig, initialConfig.activatedLanguage);
|
|
1569
|
+
const initialState = {
|
|
1570
|
+
activatedLanguage: initialConfig.activatedLanguage,
|
|
1571
|
+
languageSupport: initialConfig.languageSupport,
|
|
1572
|
+
languageSupportLoaded: true,
|
|
1573
|
+
backButton: initialLang.backButton,
|
|
1574
|
+
forwardButton: initialLang.forwardButton,
|
|
1575
|
+
sendButton: initialLang.sendButton
|
|
1576
|
+
};
|
|
1577
|
+
const slice = (0, import_toolkit.createSlice)({
|
|
1578
|
+
name,
|
|
1579
|
+
initialState,
|
|
1580
|
+
reducers: {
|
|
1581
|
+
setActivatedLanguage: (state, action) => {
|
|
1582
|
+
state.activatedLanguage = action.payload;
|
|
1583
|
+
const lang = pickLang(
|
|
1584
|
+
{ activatedLanguage: state.activatedLanguage, languageSupport: state.languageSupport },
|
|
1585
|
+
action.payload
|
|
1586
|
+
);
|
|
1587
|
+
state.backButton = lang.backButton;
|
|
1588
|
+
state.forwardButton = lang.forwardButton;
|
|
1589
|
+
state.sendButton = lang.sendButton;
|
|
1590
|
+
},
|
|
1591
|
+
setLabelsFromLanguageEntry: (state, action) => {
|
|
1592
|
+
state.backButton = action.payload.backButton;
|
|
1593
|
+
state.forwardButton = action.payload.forwardButton;
|
|
1594
|
+
state.sendButton = action.payload.sendButton;
|
|
1595
|
+
},
|
|
1596
|
+
replaceLanguageSupport: (state, action) => {
|
|
1597
|
+
state.languageSupport = action.payload.languageSupport;
|
|
1598
|
+
state.activatedLanguage = action.payload.activatedLanguage;
|
|
1599
|
+
const lang = pickLang(action.payload, action.payload.activatedLanguage);
|
|
1600
|
+
state.backButton = lang.backButton;
|
|
1601
|
+
state.forwardButton = lang.forwardButton;
|
|
1602
|
+
state.sendButton = lang.sendButton;
|
|
1603
|
+
state.languageSupportLoaded = true;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
return slice;
|
|
1608
|
+
};
|
|
1609
|
+
var makeLanguageSelectors = (selectSlice) => {
|
|
1610
|
+
const selectState = selectSlice;
|
|
1611
|
+
const selectActivatedLanguage = (state) => selectState(state).activatedLanguage;
|
|
1612
|
+
const selectLanguageSupportLoaded = (state) => selectState(state).languageSupportLoaded;
|
|
1613
|
+
const selectLanguageSupport = (state) => selectState(state).languageSupport;
|
|
1614
|
+
const selectOverallContentState = (state) => selectState(state);
|
|
1615
|
+
const selectOverallContentFromLanguageSupport = (0, import_toolkit.createSelector)(
|
|
1616
|
+
[selectState, (_, activatedLanguage) => activatedLanguage],
|
|
1617
|
+
(applicationContent, activatedLanguage) => {
|
|
1618
|
+
const match = applicationContent.languageSupport.find(
|
|
1619
|
+
(l) => l.language === activatedLanguage
|
|
1620
|
+
);
|
|
1621
|
+
if (!match) return { ...applicationContent };
|
|
1622
|
+
return {
|
|
1623
|
+
...applicationContent,
|
|
1624
|
+
backButton: match.backButton,
|
|
1625
|
+
forwardButton: match.forwardButton,
|
|
1626
|
+
sendButton: match.sendButton
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
);
|
|
1630
|
+
return {
|
|
1631
|
+
selectActivatedLanguage,
|
|
1632
|
+
selectLanguageSupportLoaded,
|
|
1633
|
+
selectLanguageSupport,
|
|
1634
|
+
selectOverallContentState,
|
|
1635
|
+
selectOverallContentFromLanguageSupport
|
|
1636
|
+
};
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1557
1639
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1558
1640
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1559
1641
|
var RenderQuestion = ({
|
|
@@ -2843,5 +2925,7 @@ var CookieBanner_default = CookieBanner;
|
|
|
2843
2925
|
TextFieldStandard,
|
|
2844
2926
|
TextHeadlineAndBodyStandard,
|
|
2845
2927
|
ValidationCheckAllVisibleQuestion,
|
|
2846
|
-
ValidationErrorSummaryList
|
|
2928
|
+
ValidationErrorSummaryList,
|
|
2929
|
+
createLanguageSlice,
|
|
2930
|
+
makeLanguageSelectors
|
|
2847
2931
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1489,6 +1489,86 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
|
|
|
1489
1489
|
}
|
|
1490
1490
|
var GroupQuestionsByStepCategoryGroup_default = groupQuestionsByStepCategoryGroup;
|
|
1491
1491
|
|
|
1492
|
+
// src/NewHelpMethodsStandard/ApplicationContentSlice/applicationContentSlice.ts
|
|
1493
|
+
import { createSlice, createSelector } from "@reduxjs/toolkit";
|
|
1494
|
+
var pickLang = (cfg, lang) => {
|
|
1495
|
+
var _a;
|
|
1496
|
+
return (_a = cfg.languageSupport.find((l) => l.language === lang)) != null ? _a : cfg.languageSupport[0];
|
|
1497
|
+
};
|
|
1498
|
+
var createLanguageSlice = (initialConfig, options) => {
|
|
1499
|
+
var _a;
|
|
1500
|
+
const name = (_a = options == null ? void 0 : options.name) != null ? _a : "applicationContent";
|
|
1501
|
+
const initialLang = pickLang(initialConfig, initialConfig.activatedLanguage);
|
|
1502
|
+
const initialState = {
|
|
1503
|
+
activatedLanguage: initialConfig.activatedLanguage,
|
|
1504
|
+
languageSupport: initialConfig.languageSupport,
|
|
1505
|
+
languageSupportLoaded: true,
|
|
1506
|
+
backButton: initialLang.backButton,
|
|
1507
|
+
forwardButton: initialLang.forwardButton,
|
|
1508
|
+
sendButton: initialLang.sendButton
|
|
1509
|
+
};
|
|
1510
|
+
const slice = createSlice({
|
|
1511
|
+
name,
|
|
1512
|
+
initialState,
|
|
1513
|
+
reducers: {
|
|
1514
|
+
setActivatedLanguage: (state, action) => {
|
|
1515
|
+
state.activatedLanguage = action.payload;
|
|
1516
|
+
const lang = pickLang(
|
|
1517
|
+
{ activatedLanguage: state.activatedLanguage, languageSupport: state.languageSupport },
|
|
1518
|
+
action.payload
|
|
1519
|
+
);
|
|
1520
|
+
state.backButton = lang.backButton;
|
|
1521
|
+
state.forwardButton = lang.forwardButton;
|
|
1522
|
+
state.sendButton = lang.sendButton;
|
|
1523
|
+
},
|
|
1524
|
+
setLabelsFromLanguageEntry: (state, action) => {
|
|
1525
|
+
state.backButton = action.payload.backButton;
|
|
1526
|
+
state.forwardButton = action.payload.forwardButton;
|
|
1527
|
+
state.sendButton = action.payload.sendButton;
|
|
1528
|
+
},
|
|
1529
|
+
replaceLanguageSupport: (state, action) => {
|
|
1530
|
+
state.languageSupport = action.payload.languageSupport;
|
|
1531
|
+
state.activatedLanguage = action.payload.activatedLanguage;
|
|
1532
|
+
const lang = pickLang(action.payload, action.payload.activatedLanguage);
|
|
1533
|
+
state.backButton = lang.backButton;
|
|
1534
|
+
state.forwardButton = lang.forwardButton;
|
|
1535
|
+
state.sendButton = lang.sendButton;
|
|
1536
|
+
state.languageSupportLoaded = true;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
return slice;
|
|
1541
|
+
};
|
|
1542
|
+
var makeLanguageSelectors = (selectSlice) => {
|
|
1543
|
+
const selectState = selectSlice;
|
|
1544
|
+
const selectActivatedLanguage = (state) => selectState(state).activatedLanguage;
|
|
1545
|
+
const selectLanguageSupportLoaded = (state) => selectState(state).languageSupportLoaded;
|
|
1546
|
+
const selectLanguageSupport = (state) => selectState(state).languageSupport;
|
|
1547
|
+
const selectOverallContentState = (state) => selectState(state);
|
|
1548
|
+
const selectOverallContentFromLanguageSupport = createSelector(
|
|
1549
|
+
[selectState, (_, activatedLanguage) => activatedLanguage],
|
|
1550
|
+
(applicationContent, activatedLanguage) => {
|
|
1551
|
+
const match = applicationContent.languageSupport.find(
|
|
1552
|
+
(l) => l.language === activatedLanguage
|
|
1553
|
+
);
|
|
1554
|
+
if (!match) return { ...applicationContent };
|
|
1555
|
+
return {
|
|
1556
|
+
...applicationContent,
|
|
1557
|
+
backButton: match.backButton,
|
|
1558
|
+
forwardButton: match.forwardButton,
|
|
1559
|
+
sendButton: match.sendButton
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
);
|
|
1563
|
+
return {
|
|
1564
|
+
selectActivatedLanguage,
|
|
1565
|
+
selectLanguageSupportLoaded,
|
|
1566
|
+
selectLanguageSupport,
|
|
1567
|
+
selectOverallContentState,
|
|
1568
|
+
selectOverallContentFromLanguageSupport
|
|
1569
|
+
};
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1492
1572
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1493
1573
|
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1494
1574
|
var RenderQuestion = ({
|
|
@@ -2777,5 +2857,7 @@ export {
|
|
|
2777
2857
|
TextFieldStandard_default as TextFieldStandard,
|
|
2778
2858
|
TextHeadlineAndBodyStandard_default as TextHeadlineAndBodyStandard,
|
|
2779
2859
|
ValidationCheckAllVisibleQuestion_default as ValidationCheckAllVisibleQuestion,
|
|
2780
|
-
ValidationErrorSummaryList_default as ValidationErrorSummaryList
|
|
2860
|
+
ValidationErrorSummaryList_default as ValidationErrorSummaryList,
|
|
2861
|
+
createLanguageSlice,
|
|
2862
|
+
makeLanguageSelectors
|
|
2781
2863
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "optimized-react-component-library-xyz123",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.91",
|
|
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",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"vitest": "^2.0.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
+
"@reduxjs/toolkit": "^2.10.1",
|
|
69
70
|
"clsx": "^2.1.1",
|
|
70
71
|
"date-fns": "^4.1.0",
|
|
71
72
|
"dompurify": "^3.2.6",
|