테스트/린트 안정화: 버튼 쿼리 모호성 제거, 훅 deps 보강, vi.spyOn 모킹, 멀티선택 Moveable 간섭 방지 재확인, 스냅 우선순위 회귀 그린
This commit is contained in:
+64
-1
@@ -39,7 +39,70 @@ const buttonObject = baseObject.extend({
|
||||
}),
|
||||
})
|
||||
|
||||
export const objectSchema = z.discriminatedUnion('type', [textObject, imageObject, buttonObject])
|
||||
const inputObject = baseObject.extend({
|
||||
type: z.literal('input'),
|
||||
props: z.object({
|
||||
name: z.string().min(1),
|
||||
label: z.string().min(1),
|
||||
placeholder: z.string().optional().default(''),
|
||||
required: z.boolean().optional().default(false),
|
||||
pattern: z.string().optional(),
|
||||
minLength: z.number().int().nonnegative().optional(),
|
||||
maxLength: z.number().int().nonnegative().optional(),
|
||||
help: z.string().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
const selectObject = baseObject.extend({
|
||||
type: z.literal('select'),
|
||||
props: z.object({
|
||||
name: z.string().min(1),
|
||||
label: z.string().min(1),
|
||||
options: z.array(z.string()).default([]),
|
||||
defaultValue: z.string().optional().default(''),
|
||||
help: z.string().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
const textareaObject = baseObject.extend({
|
||||
type: z.literal('textarea'),
|
||||
props: z.object({
|
||||
name: z.string().min(1),
|
||||
label: z.string().min(1),
|
||||
placeholder: z.string().optional().default(''),
|
||||
rows: z.number().int().positive().default(3),
|
||||
required: z.boolean().optional().default(false),
|
||||
minLength: z.number().int().nonnegative().optional(),
|
||||
maxLength: z.number().int().nonnegative().optional(),
|
||||
help: z.string().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
const radioObject = baseObject.extend({
|
||||
type: z.literal('radio'),
|
||||
props: z.object({
|
||||
name: z.string().min(1),
|
||||
legend: z.string().min(1),
|
||||
options: z.array(z.string()).default([]),
|
||||
defaultValue: z.string().optional().default(''),
|
||||
required: z.boolean().optional().default(false),
|
||||
help: z.string().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
const checkboxObject = baseObject.extend({
|
||||
type: z.literal('checkbox'),
|
||||
props: z.object({
|
||||
name: z.string().min(1),
|
||||
legend: z.string().min(1),
|
||||
options: z.array(z.string()).default([]),
|
||||
defaultValues: z.array(z.string()).default([]),
|
||||
required: z.boolean().optional().default(false),
|
||||
help: z.string().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const objectSchema = z.discriminatedUnion('type', [textObject, imageObject, buttonObject, inputObject, selectObject, textareaObject, radioObject, checkboxObject])
|
||||
export type WObject = z.infer<typeof objectSchema>
|
||||
|
||||
export const layerSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user