2
0

(rating) Add start number option in Rating block

This commit is contained in:
Baptiste Arnaud
2024-02-06 17:01:53 +01:00
parent 5a7ec5c921
commit 3e2533b934
11 changed files with 71 additions and 13 deletions

View File

@ -7,6 +7,7 @@ export const defaultRatingInputOptions = {
labels: {
button: defaultButtonLabel,
},
startsAt: 0,
customIcon: { isEnabled: false },
isOneClickSubmitEnabled: false,
} as const satisfies RatingInputBlock['options']

View File

@ -1,4 +1,5 @@
import { z } from '../../../../zod'
import { variableStringSchema } from '../../../utils'
import { optionBaseSchema, blockBaseSchema } from '../../shared'
import { InputBlockType } from '../constants'
@ -6,6 +7,7 @@ export const ratingInputOptionsSchema = optionBaseSchema.merge(
z.object({
buttonType: z.literal('Icons').or(z.literal('Numbers')).optional(),
length: z.number().optional(),
startsAt: z.number().or(variableStringSchema).optional(),
labels: z
.object({
left: z.string().optional(),