2
0

feat(inputs): Add Phone number input

This commit is contained in:
Baptiste Arnaud
2022-01-10 10:43:27 +01:00
parent 8cba7ff37b
commit b20bcb1408
19 changed files with 218 additions and 10 deletions

View File

@ -3,5 +3,4 @@ node_modules
.env
dist
types
yarn-error.log

View File

@ -2,7 +2,7 @@
"name": "models",
"version": "1.0.0",
"main": "dist/index.js",
"types": "types/index.d.ts",
"types": "dist/types/index.d.ts",
"license": "AGPL-3.0-or-later",
"private": true,
"devDependencies": {
@ -14,6 +14,6 @@
},
"scripts": {
"build": "tsc",
"dev": "tsc --watch"
"dev": "tsc --watch --preserveWatchOutput"
}
}

View File

@ -6,6 +6,7 @@ export type InputStep =
| EmailInputStep
| UrlInputStep
| DateInputStep
| PhoneNumberInputStep
export enum InputStepType {
TEXT = 'text input',
@ -13,6 +14,7 @@ export enum InputStepType {
EMAIL = 'email input',
URL = 'url input',
DATE = 'date input',
PHONE = 'phone number input',
}
export type TextInputStep = StepBase & {
@ -40,6 +42,11 @@ export type DateInputStep = StepBase & {
options?: DateInputOptions
}
export type PhoneNumberInputStep = StepBase & {
type: InputStepType.PHONE
options?: InputOptionsBase
}
export type DateInputOptions = {
labels?: { button?: string; from?: string; to?: string }
hasTime?: boolean

View File

@ -7,7 +7,7 @@
"strict": true,
"skipLibCheck": true,
"declaration": true,
"declarationDir": "./types",
"declarationDir": "./dist/types",
"outDir": "./dist"
}
}