fixed fields as per the frontend
This commit is contained in:
parent
4109dbec8d
commit
7408e7eb68
@ -1,8 +1,11 @@
|
|||||||
// ─── Parent types ───
|
// ─── 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") ───
|
// ─── 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>> = {
|
export const PARENT_TYPE_LABELS: Readonly<Record<ParentKeyType, string>> = {
|
||||||
@ -12,6 +15,7 @@ export const PARENT_TYPE_LABELS: Readonly<Record<ParentKeyType, string>> = {
|
|||||||
multiselect: "Multiselect",
|
multiselect: "Multiselect",
|
||||||
checkbox: "Checkbox",
|
checkbox: "Checkbox",
|
||||||
button:"button",
|
button:"button",
|
||||||
|
radio:"Radio"
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
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",
|
email: "Email",
|
||||||
number: "Number",
|
number: "Number",
|
||||||
password: "Password",
|
password: "Password",
|
||||||
button: "Button",
|
|
||||||
color: "Color Picker",
|
color: "Color Picker",
|
||||||
date: "Date",
|
date: "Date",
|
||||||
"datetime-local" : "Date & Time",
|
"datetime-local" : "Date & Time",
|
||||||
@ -27,7 +30,6 @@ export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
|||||||
hidden: "Hidden",
|
hidden: "Hidden",
|
||||||
image: "Image Button",
|
image: "Image Button",
|
||||||
month: "Month",
|
month: "Month",
|
||||||
radio: "Radio",
|
|
||||||
range: "Range Slider",
|
range: "Range Slider",
|
||||||
reset: "Reset Button",
|
reset: "Reset Button",
|
||||||
search: "Search",
|
search: "Search",
|
||||||
@ -38,6 +40,14 @@ export const INPUT_SUB_TYPE_LABELS: Readonly<Record<InputSubType, string>> = {
|
|||||||
week: "Week",
|
week: "Week",
|
||||||
} as const;
|
} 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 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 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