optimized-react-component-library-xyz123 0.1.96 → 0.1.98
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 +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +22 -0
- package/dist/index.mjs +20 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -467,6 +467,19 @@ declare const toggleScriptByConsent: (consent: boolean, options: {
|
|
|
467
467
|
declare const isScriptLoaded: (id: string) => boolean;
|
|
468
468
|
declare const removeScriptById: (id: string) => void;
|
|
469
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Sätter fokus på ett element med givet id (eller HTMLElement),
|
|
472
|
+
* sätter tabindex="-1" om inte redan finns, och scrollar dit smidigt.
|
|
473
|
+
*
|
|
474
|
+
* @param target Elementets id (t.ex. 'main-content') eller själva elementet.
|
|
475
|
+
*/
|
|
476
|
+
declare const focusElement: (target: string | HTMLElement | null) => void;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Plockar ut alla id:n från validationType som börjar med "groupCheck-"
|
|
480
|
+
*/
|
|
481
|
+
declare const getIdsGroupCheckValidationTypes: (validationType?: string[]) => number[];
|
|
482
|
+
|
|
470
483
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
471
484
|
|
|
472
485
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -573,4 +586,4 @@ interface CookieBannerProps {
|
|
|
573
586
|
|
|
574
587
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
575
588
|
|
|
576
|
-
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, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
|
|
589
|
+
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, focusElement, getIdsGroupCheckValidationTypes, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
|
package/dist/index.d.ts
CHANGED
|
@@ -467,6 +467,19 @@ declare const toggleScriptByConsent: (consent: boolean, options: {
|
|
|
467
467
|
declare const isScriptLoaded: (id: string) => boolean;
|
|
468
468
|
declare const removeScriptById: (id: string) => void;
|
|
469
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Sätter fokus på ett element med givet id (eller HTMLElement),
|
|
472
|
+
* sätter tabindex="-1" om inte redan finns, och scrollar dit smidigt.
|
|
473
|
+
*
|
|
474
|
+
* @param target Elementets id (t.ex. 'main-content') eller själva elementet.
|
|
475
|
+
*/
|
|
476
|
+
declare const focusElement: (target: string | HTMLElement | null) => void;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Plockar ut alla id:n från validationType som börjar med "groupCheck-"
|
|
480
|
+
*/
|
|
481
|
+
declare const getIdsGroupCheckValidationTypes: (validationType?: string[]) => number[];
|
|
482
|
+
|
|
470
483
|
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
471
484
|
|
|
472
485
|
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
|
|
@@ -573,4 +586,4 @@ interface CookieBannerProps {
|
|
|
573
586
|
|
|
574
587
|
declare const CookieBanner: React.FC<CookieBannerProps>;
|
|
575
588
|
|
|
576
|
-
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, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
|
|
589
|
+
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, focusElement, getIdsGroupCheckValidationTypes, isScriptLoaded, makeLanguageSelectors, makeQuestionsSelectors, removeScriptById, toggleScriptByConsent };
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,8 @@ __export(index_exports, {
|
|
|
63
63
|
createCookieConsent: () => createCookieConsent,
|
|
64
64
|
createLanguageSlice: () => createLanguageSlice,
|
|
65
65
|
createQuestionsSlice: () => createQuestionsSlice,
|
|
66
|
+
focusElement: () => focusElement,
|
|
67
|
+
getIdsGroupCheckValidationTypes: () => getIdsGroupCheckValidationTypes,
|
|
66
68
|
isScriptLoaded: () => isScriptLoaded,
|
|
67
69
|
makeLanguageSelectors: () => makeLanguageSelectors,
|
|
68
70
|
makeQuestionsSelectors: () => makeQuestionsSelectors,
|
|
@@ -1901,6 +1903,24 @@ var removeScriptById = (id) => {
|
|
|
1901
1903
|
if (el) el.remove();
|
|
1902
1904
|
};
|
|
1903
1905
|
|
|
1906
|
+
// src/NewHelpMethodsStandard/FocusElement/focusElement.ts
|
|
1907
|
+
var focusElement = (target) => {
|
|
1908
|
+
const element = typeof target === "string" ? document.getElementById(target) : target;
|
|
1909
|
+
if (!element) return;
|
|
1910
|
+
if (!element.hasAttribute("tabindex")) {
|
|
1911
|
+
element.setAttribute("tabindex", "-1");
|
|
1912
|
+
}
|
|
1913
|
+
element.focus();
|
|
1914
|
+
element.scrollIntoView({ behavior: "smooth" });
|
|
1915
|
+
};
|
|
1916
|
+
|
|
1917
|
+
// src/NewHelpMethodsStandard/GetIdsGroupCheckValidationTypes/getIdsGroupCheckValidationTypes.ts
|
|
1918
|
+
var getIdsGroupCheckValidationTypes = (validationType) => {
|
|
1919
|
+
if (!(validationType == null ? void 0 : validationType.length)) return [];
|
|
1920
|
+
const ids = validationType.filter((t) => t.startsWith("groupCheck-")).flatMap((t) => t.split("-").slice(1)).map((s) => Number(s)).filter((n) => Number.isFinite(n));
|
|
1921
|
+
return Array.from(new Set(ids));
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1904
1924
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1905
1925
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1906
1926
|
var RenderQuestion = ({
|
|
@@ -3194,6 +3214,8 @@ var CookieBanner_default = CookieBanner;
|
|
|
3194
3214
|
createCookieConsent,
|
|
3195
3215
|
createLanguageSlice,
|
|
3196
3216
|
createQuestionsSlice,
|
|
3217
|
+
focusElement,
|
|
3218
|
+
getIdsGroupCheckValidationTypes,
|
|
3197
3219
|
isScriptLoaded,
|
|
3198
3220
|
makeLanguageSelectors,
|
|
3199
3221
|
makeQuestionsSelectors,
|
package/dist/index.mjs
CHANGED
|
@@ -1831,6 +1831,24 @@ var removeScriptById = (id) => {
|
|
|
1831
1831
|
if (el) el.remove();
|
|
1832
1832
|
};
|
|
1833
1833
|
|
|
1834
|
+
// src/NewHelpMethodsStandard/FocusElement/focusElement.ts
|
|
1835
|
+
var focusElement = (target) => {
|
|
1836
|
+
const element = typeof target === "string" ? document.getElementById(target) : target;
|
|
1837
|
+
if (!element) return;
|
|
1838
|
+
if (!element.hasAttribute("tabindex")) {
|
|
1839
|
+
element.setAttribute("tabindex", "-1");
|
|
1840
|
+
}
|
|
1841
|
+
element.focus();
|
|
1842
|
+
element.scrollIntoView({ behavior: "smooth" });
|
|
1843
|
+
};
|
|
1844
|
+
|
|
1845
|
+
// src/NewHelpMethodsStandard/GetIdsGroupCheckValidationTypes/getIdsGroupCheckValidationTypes.ts
|
|
1846
|
+
var getIdsGroupCheckValidationTypes = (validationType) => {
|
|
1847
|
+
if (!(validationType == null ? void 0 : validationType.length)) return [];
|
|
1848
|
+
const ids = validationType.filter((t) => t.startsWith("groupCheck-")).flatMap((t) => t.split("-").slice(1)).map((s) => Number(s)).filter((n) => Number.isFinite(n));
|
|
1849
|
+
return Array.from(new Set(ids));
|
|
1850
|
+
};
|
|
1851
|
+
|
|
1834
1852
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1835
1853
|
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1836
1854
|
var RenderQuestion = ({
|
|
@@ -3123,6 +3141,8 @@ export {
|
|
|
3123
3141
|
createCookieConsent,
|
|
3124
3142
|
createLanguageSlice,
|
|
3125
3143
|
createQuestionsSlice,
|
|
3144
|
+
focusElement,
|
|
3145
|
+
getIdsGroupCheckValidationTypes,
|
|
3126
3146
|
isScriptLoaded,
|
|
3127
3147
|
makeLanguageSelectors,
|
|
3128
3148
|
makeQuestionsSelectors,
|
package/package.json
CHANGED