diff --git a/packages/core/src/components/question/InputComponentMapper.ts b/packages/core/src/components/question/InputComponentMapper.ts index 869d353..e535f0b 100644 --- a/packages/core/src/components/question/InputComponentMapper.ts +++ b/packages/core/src/components/question/InputComponentMapper.ts @@ -26,6 +26,7 @@ export const inputTypeComponentMap = { radio: TextInput, slider: TextInput, multilinetext: MultilineInput, + email: TextInput, // lastName: LastNameInput, // industry: IndustryInput, // role: RoleInput, diff --git a/packages/core/src/model/InputType.ts b/packages/core/src/model/InputType.ts index ac249bb..6f6b02f 100644 --- a/packages/core/src/model/InputType.ts +++ b/packages/core/src/model/InputType.ts @@ -24,6 +24,8 @@ const Slider = "slider"; const Multilinetext = "multilinetext" const Text = "text" +const Email = "email" + export interface InputTypeMap { [Dropdown]: DropDownProperties; [Radio]: RadioProperties; @@ -59,4 +61,9 @@ export type MultilineProperties = { export type TextProperties = { inputType: typeof Text; rows?: any; +} + +export type EmailProperties = { + inputType: typeof Email; + rows?: any; } \ No newline at end of file diff --git a/packages/core/src/model/json/JsonDataModels.ts b/packages/core/src/model/json/JsonDataModels.ts index fdee708..14b1daf 100644 --- a/packages/core/src/model/json/JsonDataModels.ts +++ b/packages/core/src/model/json/JsonDataModels.ts @@ -1,7 +1,7 @@ import { EndingModel } from "../EndingModel"; import { IntroModel } from "../IntroModel"; import { QuestionModel } from "../QuestionModel"; -import { DropDownProperties, MultilineProperties, RadioProperties, SliderProperties, TextProperties } from "../InputType"; +import { DropDownProperties, EmailProperties, MultilineProperties, RadioProperties, SliderProperties, TextProperties } from "../InputType"; import { Layout } from "./Layout"; @@ -20,7 +20,8 @@ export type QuestionJsonModel = QuickFormQuestionDefinition & RadioProperties | QuickFormQuestionDefinition & SliderProperties | QuickFormQuestionDefinition & MultilineProperties | - QuickFormQuestionDefinition & TextProperties + QuickFormQuestionDefinition & TextProperties | + QuickFormQuestionDefinition & EmailProperties ; diff --git a/packages/core/src/services/ModelTransformer.ts b/packages/core/src/services/ModelTransformer.ts deleted file mode 100644 index 71d4bd2..0000000 --- a/packages/core/src/services/ModelTransformer.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { QuickFormModelTransformer, registerQuickFormService, resolveQuickFormService } from "./QuickFormServices"; -import { Column, DropDownProperties, QuickFormModel, Layout, QuestionModel, QuestionRef, RadioProperties, Row, SlideElement, SlideModel, SliderProperties, SubmitModel } from "../model"; -import { QuestionJsonModel } from "../model/json/JsonDataModels"; -import { QuickFormSubmitDefinition } from "model/json/QuickFormSubmitDefinition"; -import { QuickFormQuestionsDefinition } from "../model/QuickFormQuestionsDefinition"; -import { error } from "console"; - diff --git a/packages/core/src/services/defaults/DefaultModelTransformer.ts b/packages/core/src/services/defaults/DefaultModelTransformer.ts index 8330fef..567dc57 100644 --- a/packages/core/src/services/defaults/DefaultModelTransformer.ts +++ b/packages/core/src/services/defaults/DefaultModelTransformer.ts @@ -1,9 +1,9 @@ import { Column, Layout, QuestionModel, QuestionRef, Row, SlideElements, SlideModel, SubmitModel } from "../../model"; import { QuickFormModel } from "../../model/QuickFormModel"; import { QuickFormQuestionsDefinition } from "../../model/QuickFormQuestionsDefinition"; -import { QuickFormSubmitDefinition } from "model/json/QuickFormSubmitDefinition"; import { QuickFormModelTransformer, registerQuickFormService, resolveQuickFormService } from "../QuickFormServices"; import { QuestionJsonModel } from "../../model/json/JsonDataModels"; +import { QuickFormSubmitDefinition } from "../../model/json/QuickFormSubmitDefinition"; function isDefined(object?: object) {