Skip to content

Commit

Permalink
fix: added email inputType
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Feb 8, 2024
1 parent 6c34612 commit 68e0869
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const inputTypeComponentMap = {
radio: TextInput,
slider: TextInput,
multilinetext: MultilineInput,
email: TextInput,
// lastName: LastNameInput,
// industry: IndustryInput,
// role: RoleInput,
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/model/InputType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const Slider = "slider";
const Multilinetext = "multilinetext"
const Text = "text"

const Email = "email"

export interface InputTypeMap {
[Dropdown]: DropDownProperties;
[Radio]: RadioProperties;
Expand Down Expand Up @@ -59,4 +61,9 @@ export type MultilineProperties = {
export type TextProperties = {
inputType: typeof Text;
rows?: any;
}

export type EmailProperties = {
inputType: typeof Email;
rows?: any;
}
5 changes: 3 additions & 2 deletions packages/core/src/model/json/JsonDataModels.ts
Original file line number Diff line number Diff line change
@@ -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";


Expand All @@ -20,7 +20,8 @@ export type QuestionJsonModel =
QuickFormQuestionDefinition & RadioProperties |
QuickFormQuestionDefinition & SliderProperties |
QuickFormQuestionDefinition & MultilineProperties |
QuickFormQuestionDefinition & TextProperties
QuickFormQuestionDefinition & TextProperties |
QuickFormQuestionDefinition & EmailProperties
;


Expand Down
7 changes: 0 additions & 7 deletions packages/core/src/services/ModelTransformer.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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) {
Expand Down

0 comments on commit 68e0869

Please sign in to comment.