2022-06-07 08:49:12 +02:00
|
|
|
import { z } from 'zod'
|
|
|
|
import { choiceInputOptionsSchema, choiceInputSchema } from './choice'
|
|
|
|
import { dateInputOptionsSchema, dateInputSchema } from './date'
|
|
|
|
import { emailInputOptionsSchema, emailInputSchema } from './email'
|
|
|
|
import { numberInputOptionsSchema, numberInputSchema } from './number'
|
|
|
|
import { paymentInputOptionsSchema, paymentInputSchema } from './payment'
|
|
|
|
import {
|
|
|
|
phoneNumberInputOptionsSchema,
|
2022-06-11 07:27:38 +02:00
|
|
|
phoneNumberInputBlockSchema,
|
2022-06-07 08:49:12 +02:00
|
|
|
} from './phone'
|
2022-06-11 07:27:38 +02:00
|
|
|
import { ratingInputOptionsSchema, ratingInputBlockSchema } from './rating'
|
2022-06-07 08:49:12 +02:00
|
|
|
import { textInputOptionsSchema, textInputSchema } from './text'
|
2022-06-12 17:34:33 +02:00
|
|
|
import { fileInputOptionsSchema, fileInputStepSchema } from './file'
|
2022-06-07 08:49:12 +02:00
|
|
|
import { urlInputOptionsSchema, urlInputSchema } from './url'
|
2023-01-25 11:27:47 +01:00
|
|
|
import { optionBaseSchema } from '../baseSchemas'
|
2022-06-07 08:49:12 +02:00
|
|
|
|
|
|
|
export type OptionBase = z.infer<typeof optionBaseSchema>
|
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export const inputBlockOptionsSchema = textInputOptionsSchema
|
2022-06-07 08:49:12 +02:00
|
|
|
.or(choiceInputOptionsSchema)
|
|
|
|
.or(emailInputOptionsSchema)
|
|
|
|
.or(numberInputOptionsSchema)
|
|
|
|
.or(urlInputOptionsSchema)
|
|
|
|
.or(phoneNumberInputOptionsSchema)
|
|
|
|
.or(dateInputOptionsSchema)
|
|
|
|
.or(paymentInputOptionsSchema)
|
2022-06-07 19:09:08 +02:00
|
|
|
.or(ratingInputOptionsSchema)
|
2022-06-12 17:34:33 +02:00
|
|
|
.or(fileInputOptionsSchema)
|
2022-06-07 08:49:12 +02:00
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export const inputBlockSchema = textInputSchema
|
2022-06-07 08:49:12 +02:00
|
|
|
.or(numberInputSchema)
|
|
|
|
.or(emailInputSchema)
|
|
|
|
.or(urlInputSchema)
|
|
|
|
.or(dateInputSchema)
|
2022-06-11 07:27:38 +02:00
|
|
|
.or(phoneNumberInputBlockSchema)
|
2022-06-07 08:49:12 +02:00
|
|
|
.or(choiceInputSchema)
|
|
|
|
.or(paymentInputSchema)
|
2022-06-11 07:27:38 +02:00
|
|
|
.or(ratingInputBlockSchema)
|
2022-06-12 17:34:33 +02:00
|
|
|
.or(fileInputStepSchema)
|
2022-06-07 08:49:12 +02:00
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export type InputBlock = z.infer<typeof inputBlockSchema>
|
|
|
|
export type InputBlockOptions = z.infer<typeof inputBlockOptionsSchema>
|