fixed fields as per the frontend
This commit is contained in:
parent
4109dbec8d
commit
7408e7eb68
@ -1,8 +1,11 @@
|
||||
// ─── Parent types ───
|
||||
export type ParentKeyType = "input" | "textarea" | "select" | "multiselect" | "checkbox"|"button";
|
||||
export type ParentKeyType = "input" | "textarea" | "select" | "multiselect" | "checkbox"|"button"|"radio";
|
||||
|
||||
// ─── Child types (only for "input") ───
|
||||
export type InputSubType = "text" | "email" | "number" | "password" | "button" | "color" | "date" | "datetime-local" | "file" | "hidden" | "image" | "month" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "time" | "url" | "week" ;
|
||||
export type InputSubType = "text" | "email" | "number" | "password" | "color" | "date" | "datetime-local" | "file" | "hidden" | "image" | "month" | "range" | "reset" | "search" | "submit" | "tel" | "time" | "url" | "week" ;
|
||||
|
||||
// button subtypes — maps to HTML <input type="..."> or <button type="...">
|
||||
export type ButtonSubType = "button" | "submit" | "reset" | "image";
|
||||
|
||||
|
||||
export const PARENT_TYPE_LABELS: Readonly<Record<ParentKeyType, string>> = {
|
||||
@ -12,6 +15,7 @@ export const PARENT_TYPE_LABELS: Readonly<Record<ParentKeyType, string>> = {
|
||||
multiselect: "Multiselect",
|
||||
checkbox: "Checkbox",
|
||||
button:"button",
|
||||
radio:"Radio"
|
||||
} as const;
|
||||
|
||||
export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
||||
@ -19,7 +23,6 @@ export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
||||
email: "Email",
|
||||
number: "Number",
|
||||
password: "Password",
|
||||
button: "Button",
|
||||
color: "Color Picker",
|
||||
date: "Date",
|
||||
"datetime-local" : "Date & Time",
|
||||
@ -27,7 +30,6 @@ export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
||||
hidden: "Hidden",
|
||||
image: "Image Button",
|
||||
month: "Month",
|
||||
radio: "Radio",
|
||||
range: "Range Slider",
|
||||
reset: "Reset Button",
|
||||
search: "Search",
|
||||
@ -38,6 +40,14 @@ export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
||||
week: "Week",
|
||||
} as const;
|
||||
|
||||
export const BUTTON_SUB_TYPE_LABELS: Readonly<Record<ButtonSubType, string>> = {
|
||||
button: "Button",
|
||||
submit: "Submit",
|
||||
reset: "Reset",
|
||||
image: "Image",
|
||||
} as const;
|
||||
|
||||
export const PARENT_TYPE_KEYS = Object.keys(PARENT_TYPE_LABELS) as ParentKeyType[];
|
||||
export const INPUT_SUB_TYPE_KEYS = Object.keys(INPUT_SUB_TYPE_LABELS) as InputSubType[];
|
||||
export const BUTTON_SUB_TYPE_KEYS = Object.keys(BUTTON_SUB_TYPE_LABELS) as ButtonSubType[];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user