optimized-react-component-library-xyz123
Version:
A modern React component library using TypeScript with React 19 support.
331 lines (279 loc) • 10.1 kB
TypeScript
import React, { FC } from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';
interface IApplicationContent {
mainHeadline?: string;
ingressBody?: string;
linksForMoreInfo?: Array<IPTSLink>;
pageTitle?: string;
textblocks?: Array<ITextBlock>;
languageSupport: [
{
language: string;
mainHeadline: string;
ingressBody: string;
linksForMoreInfo: Array<IPTSLink>;
pageTitle: string;
textblocks: Array<ITextBlock>;
}
];
}
interface IFormState {
applicationContent: IApplicationContent;
steps: Array<IStepObject>;
questions: Array<IQuestion>;
questionsLoaded: boolean;
status: 'notloaded' | 'idle' | 'loading' | 'failed' | 'success';
}
interface IOption {
label: string;
value: string;
}
interface IPTSLink {
title: string;
url: string;
ariaLabel: string;
}
interface IStepObject {
step: number;
stepHeadline?: string;
stepDescription?: string;
shortNameInStepper: string;
shortNameInPreview?: string;
languageSupport?: Array<any>;
}
interface ITextBlock {
id?: string;
headline?: string;
body?: string;
linksForMoreInfo?: Array<IPTSLink>;
pageTitle?: string;
}
interface IQuestion {
id?: number;
mappingId?: string;
step?: number;
categoryLabel?: string;
categoryDescription?: string;
hideCategory?: boolean;
questionLabel?: string;
previewLabel?: string;
validationSummaryLabel?: string;
hideQuestion?: boolean;
answer?: string;
files?: Array<File | {
file: File;
dataURL: string;
id?: string;
}>;
aboutText?: string;
isQuestionMandatory?: boolean;
questionType?: string;
options?: Array<IOption>;
visible?: boolean;
isDisplayed?: boolean;
hasValidationError?: boolean;
validationType?: Array<string>;
validationDefaultMessesege?: string;
questionGroupId?: number;
questionGroupType?: string;
dependsOnOtherQuestion?: Array<any>;
questionExtraAttribute?: IQuestionExtraAttribute;
languageSupport: Array<any>;
}
interface IQuestionExtraAttribute {
answerMaxLength?: number;
disabled?: boolean;
autoComplete?: string;
inputType?: string;
showTextAreaCounter?: boolean;
hideValidationMessage?: boolean;
hideTextCounter?: boolean;
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
spellCheck?: boolean;
autoCapitalize?: string;
}
interface IStepQuestionData {
step: number;
stepHeadline?: string;
stepDescription?: string;
categories?: {
visible?: boolean;
isDisplayed?: boolean;
category: string;
questionGroups: {
questionGroupId: string;
questionGroupType: string;
questions: IQuestion[];
}[];
}[];
}
interface RadioProps {
question: IQuestion;
isTouched: any;
showPreview?: boolean;
}
declare const InputRadio: FC<RadioProps>;
interface MultipleCheckboxesProps {
question: IQuestion;
isTouched: any;
showPreview?: boolean;
activatedLanguage?: string;
}
declare const MultipleCheckboxes: FC<MultipleCheckboxesProps>;
interface TextAreaProps {
question: IQuestion;
isTouched: any;
showPreview?: boolean;
activatedLanguage?: string;
}
declare const InputTextarea: FC<TextAreaProps>;
interface TextFieldStandardProps {
question: IQuestion;
isTouched: any;
showPreview?: boolean;
activatedLanguage?: string;
}
declare const TextFieldStandard: FC<TextFieldStandardProps>;
interface SelectedFile {
id: string;
file: File;
dataURL?: string;
}
interface FilesUploadStandardProps {
question: IQuestion;
isTouched: any;
visible?: boolean;
showPreview?: boolean;
activatedLanguage?: string;
allowedFileTypes?: Array<string>;
allowedNumberOfFiles?: number;
allowedTotalFileSize?: number;
onFilesAdded?: (files: SelectedFile[]) => void;
onFileRemoved?: (fileId: string) => void;
maxFileSize?: number;
allowDuplicates?: boolean;
multiple?: boolean;
}
declare const FilesUpload: React.FC<FilesUploadStandardProps>;
interface AddFilesProps {
questionObject: IQuestion;
isTouched: any;
visible?: boolean;
showPreview?: boolean;
activatedLanguage?: string;
allowedFileTypes?: Array<string>;
allowedNumberOfFiles?: number;
allowedTotalFileSize?: number;
}
declare const AddFiles: FC<AddFilesProps>;
declare const questionHasValidationError: (questionObject: any, arrayOfQuestionObjects: any[]) => boolean;
interface TranslatedAnswers {
[questionId: string]: {
[originalAnswer: string]: string;
};
}
interface ApiDataObject {
[key: string]: string | number | boolean | File[];
}
declare function CreateApiDataObject(data: any[], specialMappedQuestions: Set<string>, translatedAnswers: TranslatedAnswers): ApiDataObject;
declare function groupQuestionByStepPreviewPage(steps: IStepObject[], questions: IQuestion[]): any[];
declare const isDependsOnOtherQuestionTrue: (data: any[], question: any) => boolean;
interface ILanguageSupport {
languageSupport?: Array<ILanguage>;
activatedLanguage: string;
forwardButton?: string;
backButton?: string;
sendButton?: string;
languageSupportLoaded: boolean;
}
interface ILanguage {
language: string;
forwardButton: string;
backButton: string;
sendButton: string;
}
declare const QuestioninitialState: IFormState;
declare const ILanguageSupportinitialState: ILanguageSupport;
declare const doCategoriesAndQuestionsVisible: (questions: IQuestion[], validationErrorsList: number[]) => any[];
declare function validationCheckAllVisibleQuestions(data: any, formQuestion: any): number[];
declare function groupQuestionsByStepCategoryGroup(questions: IQuestion[], steps: IStepObject[], validationErrorsList: number[]): any[];
declare const RenderQuestion: ({ question, isTouched, activatedLanguage, showPreview, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
declare const RenderQuestionGroup: ({ questionArray, wrapper, legend, isTouched, activatedLanguage, showPreview, AddQuestionDisplayed, hideValidationMessage, }: any) => react_jsx_runtime.JSX.Element;
interface EditPreviewLinkProps {
step: IStepObject;
changeStepHandler: any;
activatedLanguage?: string;
}
declare const EditPreviewLink: FC<EditPreviewLinkProps>;
interface FooterProps {
activatedLanguage?: string;
}
declare const Footer: FC<FooterProps>;
interface HeaderProps {
activatedLanguage?: string;
useLanguage?: boolean;
SetActivatedLanguage?: (language: string) => void;
}
declare const Header: FC<HeaderProps>;
interface InfoOnlyProps {
questionObject: IQuestion;
isTouched: any;
visible?: boolean;
showErrors?: boolean;
showPreview?: boolean;
showConfigure?: boolean;
tabIndex?: number;
activatedLanguage?: string;
}
declare const InfoOnly: FC<InfoOnlyProps>;
interface ModalProps {
showModal: boolean;
activatedLanguage?: string;
}
declare const Modal: FC<ModalProps>;
interface PrincipleOfPublicityProps {
activatedLanguage?: string;
}
declare const PrincipleOfPublicity: FC<PrincipleOfPublicityProps>;
interface ServiceHeadlineAndBodyProps {
data: IApplicationContent;
activeStep?: number;
}
declare const ServiceHeadlineAndBody: FC<ServiceHeadlineAndBodyProps>;
declare const SkipLink: FC;
interface StepperButtonsProps {
languageSupported?: any;
handleActiveStep: (activeStep: number) => void;
forwardButtonHandler?: (e: any) => void;
submitButtonHandler?: (e: any) => void;
arraySteps?: any[];
activeStep: number;
}
declare const StepperButtons: FC<StepperButtonsProps>;
interface StepperProps {
arraySteps?: Array<IStepObject>;
activeStep?: number;
}
declare const Stepper: FC<StepperProps>;
interface TextHeadlineAndBodyProps {
data: ITextBlock;
headlineType?: 'h1' | 'h2';
}
declare const TextHeadlineAndBody: FC<TextHeadlineAndBodyProps>;
interface ValidationErrorSummaryListProps {
formQuestions: any[];
activatedLanguage: string;
validationErrorsList: any[];
summaryText?: string;
}
declare const ValidationErrorSummaryList: React.FC<ValidationErrorSummaryListProps>;
interface CookieBannerProps {
isTouched?: any;
onCookieStateChange?: () => void;
visible?: boolean;
onClose?: () => void;
acceptCookies: () => void;
rejectCookies: () => void;
}
declare const CookieBanner: React.FC<CookieBannerProps>;
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 };