-
-
-
-
-
+
+
+
+
-
- {{ fieldData.description }}
-
+ {{ fieldData.description }}
diff --git a/frontend/src/components/builder/field-editor/FieldPropertiesForm.vue b/frontend/src/components/builder/field-editor/FieldPropertiesForm.vue
index 4183359..38cc19a 100644
--- a/frontend/src/components/builder/field-editor/FieldPropertiesForm.vue
+++ b/frontend/src/components/builder/field-editor/FieldPropertiesForm.vue
@@ -1,7 +1,8 @@
- handleChange(file)"
- >
+ handleChange(file)">
-
+
(() => {
editorClass="prose-sm !border-none !p-0 !shadow-none"
/>
-
+
{{ value }}
+
+ {{ value }}
+
{{ value ?? "–" }}
diff --git a/frontend/src/config/fieldTypes.ts b/frontend/src/config/fieldTypes.ts
new file mode 100644
index 0000000..a83a6ed
--- /dev/null
+++ b/frontend/src/config/fieldTypes.ts
@@ -0,0 +1,266 @@
+/**
+ * SINGLE SOURCE OF TRUTH for field type metadata.
+ *
+ * Every property that varies by field type — Vue component, layout behaviour,
+ * Frappe fieldtype mapping, boolean/date semantics — lives here. Nothing else
+ * in the frontend should hardcode field-type-specific logic; import from this
+ * file and derive from the registry instead.
+ *
+ * The `Fieldtype` enum itself is auto-generated from `form_field.json` via
+ * frappe-types, so the JSON is the ground truth for the list of valid names.
+ * This registry owns everything that can't be auto-generated.
+ *
+ * To add a new field type:
+ * 1. Add the option to `form_field.json`
+ * → `DF.Literal` (Python) and `Fieldtype` (TS) regenerate automatically.
+ * 2. TypeScript will error in FIELD_TYPE_DEFINITIONS below until you add an entry.
+ * 3. Add a matching entry to `FORM_TO_FRAPPE_FIELDTYPE` in `form_field.py`.
+ * 4. Create a Vue component if the type needs a new input widget.
+ */
+
+import type { Component } from "vue";
+import {
+ Checkbox,
+ DatePicker,
+ DateRangePicker,
+ DateTimePicker,
+ Password,
+ Rating,
+ Select,
+ Switch,
+ Textarea,
+ TextEditor,
+ TimePicker,
+ FormControl,
+} from "frappe-ui";
+import Attachment from "@/components/fields/Attachment.vue";
+import Phone from "@/components/fields/Phone.vue";
+import Table from "@/components/fields/Table.vue";
+import { Fieldtype } from "@/types/FormsPro/form_field.types";
+
+export { Fieldtype };
+
+/**
+ * Controls how FieldRenderer positions the label relative to the input widget.
+ *
+ * - "default" label on top, input below, description at the bottom
+ * - "inline" input first, label to the right (Switch, Checkbox)
+ * - "description-first" label on top, description below label, input at the bottom (Text Editor)
+ * - "custom" the component handles its own full layout (Table)
+ */
+export type FieldLayout = "default" | "inline" | "description-first" | "custom";
+
+export type FieldTypeDefinition = {
+ /** Canonical name — must match a Fieldtype enum value */
+ name: Fieldtype;
+ /** Vue component used to render this field in input mode */
+ component: Component;
+ /** Default props forwarded to the component */
+ props: Record;
+ /** How FieldRenderer lays out the label relative to the input */
+ layout: FieldLayout;
+ /** Frappe fieldtype to use when syncing this field to a DocType */
+ frappeFieldtype: string;
+ /** Override the `options` value on the Frappe CustomField (e.g. "Email" for Data fields) */
+ frappeOptions?: string;
+ /** True for Switch / Checkbox — affects conditional logic evaluation and display */
+ isBoolean: boolean;
+ /** True for Date / DateTime / DateRange / TimePicker — affects display formatting */
+ isDate: boolean;
+};
+
+export const FIELD_TYPE_DEFINITIONS: FieldTypeDefinition[] = [
+ {
+ name: Fieldtype.ATTACH,
+ component: Attachment,
+ props: {
+ variant: "outline",
+ filetypes: ["image/*", ".jpg", ".gif", ".pdf"],
+ },
+ layout: "custom",
+ frappeFieldtype: "Attach",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.DATA,
+ component: FormControl,
+ props: { type: "text", variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Data",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.NUMBER,
+ component: FormControl,
+ props: { type: "number", variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Int",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.EMAIL,
+ component: FormControl,
+ props: { type: "email", variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Data",
+ frappeOptions: "Email",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.DATE,
+ component: DatePicker,
+ props: { variant: "outline", clearable: true, format: "D MMM YYYY" },
+ layout: "default",
+ frappeFieldtype: "Date",
+ isBoolean: false,
+ isDate: true,
+ },
+ {
+ name: Fieldtype.DATE_TIME,
+ component: DateTimePicker,
+ props: {
+ format: "DD MMM YYYY, hh:mm A",
+ clearable: true,
+ variant: "outline",
+ },
+ layout: "default",
+ frappeFieldtype: "Datetime",
+ isBoolean: false,
+ isDate: true,
+ },
+ {
+ name: Fieldtype.DATE_RANGE,
+ component: DateRangePicker,
+ props: { clearable: true, variant: "outline", format: "DD MMM 'YY" },
+ layout: "default",
+ frappeFieldtype: "Data",
+ isBoolean: false,
+ isDate: true,
+ },
+ {
+ name: Fieldtype.TIME_PICKER,
+ component: TimePicker,
+ props: { variant: "outline", use12Hour: true, clearable: true },
+ layout: "default",
+ frappeFieldtype: "Time",
+ isBoolean: false,
+ isDate: true,
+ },
+ {
+ name: Fieldtype.PASSWORD,
+ component: Password,
+ props: { variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Password",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.SELECT,
+ component: Select,
+ props: { variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Select",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.PHONE,
+ component: Phone,
+ props: { variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Phone",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.SWITCH,
+ component: Switch,
+ props: {},
+ layout: "inline",
+ frappeFieldtype: "Check",
+ isBoolean: true,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.TEXTAREA,
+ component: Textarea,
+ props: { variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Text",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.TEXT_EDITOR,
+ component: TextEditor,
+ props: {
+ editorClass:
+ "bg-surface-white w-full rounded-b form-description border rounded-b min-h-24",
+ fixedMenu: true,
+ bubbleMenu: true,
+ starterkitOptions: { heading: { levels: [2, 3, 4] } },
+ },
+ layout: "description-first",
+ frappeFieldtype: "Text Editor",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.LINK,
+ component: Select,
+ props: { variant: "outline" },
+ layout: "default",
+ frappeFieldtype: "Link",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.CHECKBOX,
+ component: Checkbox,
+ props: {},
+ layout: "inline",
+ frappeFieldtype: "Check",
+ isBoolean: true,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.RATING,
+ component: Rating,
+ props: {},
+ layout: "default",
+ frappeFieldtype: "Rating",
+ isBoolean: false,
+ isDate: false,
+ },
+ {
+ name: Fieldtype.TABLE,
+ component: Table,
+ props: {
+ options: {
+ emptyState: {
+ title: "This is a table field",
+ description: "Use this field to input a list of items.",
+ },
+ },
+ },
+ layout: "custom",
+ frappeFieldtype: "Table",
+ isBoolean: false,
+ isDate: false,
+ },
+];
+
+export const FIELD_TYPE_MAP = new Map(
+ FIELD_TYPE_DEFINITIONS.map((d) => [d.name, d])
+);
+
+export function getFieldTypeDef(
+ name: Fieldtype
+): FieldTypeDefinition | undefined {
+ return FIELD_TYPE_MAP.get(name);
+}
diff --git a/frontend/src/stores/editForm.ts b/frontend/src/stores/editForm.ts
index 4425f7b..f6cc4f0 100644
--- a/frontend/src/stores/editForm.ts
+++ b/frontend/src/stores/editForm.ts
@@ -2,7 +2,7 @@ import { defineStore } from "pinia";
import { ref, computed } from "vue";
import { createDocumentResource, createResource } from "frappe-ui";
import { mapDoctypeFieldForForm } from "@/utils/form_fields";
-import { FormField, FormFieldTypes } from "@/types/formfield";
+import { FormField, Fieldtype } from "@/types/formfield";
import { Form } from "@/types/form";
import { toast } from "vue-sonner";
@@ -119,7 +119,7 @@ export const useEditForm = defineStore("editForm", () => {
function saveAndPublish() {
if (formResource.value) {
formResource.value.doc.is_published = 1;
- save();
+ return save();
}
}
@@ -151,11 +151,11 @@ export const useEditForm = defineStore("editForm", () => {
}
}
- function addField(fieldtype: string) {
+ function addField(fieldtype: Fieldtype) {
if (formResource.value?.doc) {
const newField: FormField = {
idx: formResource.value.doc.fields.length + 1,
- fieldtype: fieldtype as FormFieldTypes,
+ fieldtype,
label: "",
fieldname: "",
options: "",
diff --git a/frontend/src/types/FormsPro/form.types.ts b/frontend/src/types/FormsPro/form.types.ts
new file mode 100644
index 0000000..1293ece
--- /dev/null
+++ b/frontend/src/types/FormsPro/form.types.ts
@@ -0,0 +1,38 @@
+import { FormField } from "./form_field.types";
+
+export interface Form {
+ name: string;
+ creation: string;
+ modified: string;
+ owner: string;
+ modified_by: string;
+ docstatus: 0 | 1 | 2;
+ parent?: string;
+ parentfield?: string;
+ parenttype?: string;
+ idx?: number;
+ /** Is Published? : Check */
+ is_published?: 0 | 1;
+ /** Route : Data */
+ route?: string;
+ /** Title : Data */
+ title: string;
+ /** Linked Doctype : Link - DocType */
+ linked_doctype: string;
+ /** Linked Team : Link - FP Team */
+ linked_team_id: string;
+ /** Login Required : Check */
+ login_required?: 0 | 1;
+ /** Allow Incomplete Forms : Check - Allow saving Draft forms */
+ allow_incomplete?: 0 | 1;
+ /** Success Title : Data */
+ success_title?: string;
+ /** Success Description : Text Editor */
+ success_description?: string;
+ /** Description : Text Editor */
+ description?: string;
+ /** Fields : Table - Form Field */
+ fields?: FormField[];
+ /** Meta Data : Code */
+ metadata?: string;
+}
diff --git a/frontend/src/types/FormsPro/form_field.types.ts b/frontend/src/types/FormsPro/form_field.types.ts
new file mode 100644
index 0000000..ca9278c
--- /dev/null
+++ b/frontend/src/types/FormsPro/form_field.types.ts
@@ -0,0 +1,51 @@
+export enum Fieldtype {
+ "ATTACH" = "Attach",
+ "DATA" = "Data",
+ "NUMBER" = "Number",
+ "EMAIL" = "Email",
+ "DATE" = "Date",
+ "DATE_TIME" = "Date Time",
+ "DATE_RANGE" = "Date Range",
+ "TIME_PICKER" = "Time Picker",
+ "PASSWORD" = "Password",
+ "SELECT" = "Select",
+ "SWITCH" = "Switch",
+ "TEXTAREA" = "Textarea",
+ "TEXT_EDITOR" = "Text Editor",
+ "LINK" = "Link",
+ "CHECKBOX" = "Checkbox",
+ "RATING" = "Rating",
+ "PHONE" = "Phone",
+ "TABLE" = "Table",
+}
+
+export interface FormField {
+ name: string;
+ creation: string;
+ modified: string;
+ owner: string;
+ modified_by: string;
+ docstatus: 0 | 1 | 2;
+ parent?: string;
+ parentfield?: string;
+ parenttype?: string;
+ idx?: number;
+ /** Mandatory : Check */
+ reqd?: 0 | 1;
+ /** Hidden : Check */
+ hidden?: 0 | 1;
+ /** Label : Data */
+ label: string;
+ /** Fieldtype : Select */
+ fieldtype: Fieldtype;
+ /** Fieldname : Data */
+ fieldname: string;
+ /** Description : Small Text */
+ description?: string;
+ /** Options : Small Text */
+ options?: string;
+ /** Default : Small Text */
+ default?: string;
+ /** Conditional Logic : Code */
+ conditional_logic?: string;
+}
diff --git a/frontend/src/types/FormsPro/fpteam.types.ts b/frontend/src/types/FormsPro/fpteam.types.ts
new file mode 100644
index 0000000..faa490d
--- /dev/null
+++ b/frontend/src/types/FormsPro/fpteam.types.ts
@@ -0,0 +1,20 @@
+import { FPTeamMember } from "./fpteam_member.types";
+
+export interface FPTeam {
+ name: string;
+ creation: string;
+ modified: string;
+ owner: string;
+ modified_by: string;
+ docstatus: 0 | 1 | 2;
+ parent?: string;
+ parentfield?: string;
+ parenttype?: string;
+ idx?: number;
+ /** Logo : Attach Image */
+ logo?: string;
+ /** Team Name : Data */
+ team_name: string;
+ /** Users : Table MultiSelect - FP Team Member */
+ users?: FPTeamMember[];
+}
diff --git a/frontend/src/types/FormsPro/fpteam_member.types.ts b/frontend/src/types/FormsPro/fpteam_member.types.ts
new file mode 100644
index 0000000..1fe67e6
--- /dev/null
+++ b/frontend/src/types/FormsPro/fpteam_member.types.ts
@@ -0,0 +1,14 @@
+export interface FPTeamMember {
+ name: string;
+ creation: string;
+ modified: string;
+ owner: string;
+ modified_by: string;
+ docstatus: 0 | 1 | 2;
+ parent?: string;
+ parentfield?: string;
+ parenttype?: string;
+ idx?: number;
+ /** User : Link - User */
+ user?: string;
+}
diff --git a/frontend/src/types/formfield.ts b/frontend/src/types/formfield.ts
index 32c26ca..edfa075 100644
--- a/frontend/src/types/formfield.ts
+++ b/frontend/src/types/formfield.ts
@@ -1,28 +1,10 @@
-export enum FormFieldTypes {
- Attach = "Attach",
- Data = "Data",
- Number = "Number",
- Email = "Email",
- Date = "Date",
- DateTime = "Date Time",
- DateRange = "Date Range",
- TimePicker = "Time Picker",
- Password = "Password",
- Select = "Select",
- Phone = "Phone",
- Switch = "Switch",
- Textarea = "Textarea",
- TextEditor = "Text Editor",
- Link = "Link",
- Checkbox = "Checkbox",
- Rating = "Rating",
- Table = "Table",
-}
+export { Fieldtype } from "@/types/FormsPro/form_field.types";
+import { Fieldtype } from "@/types/FormsPro/form_field.types";
export type FormField = {
label: string;
fieldname: string;
- fieldtype: FormFieldTypes;
+ fieldtype: Fieldtype;
description?: string;
reqd?: boolean;
hidden?: boolean;
diff --git a/frontend/src/utils/conditionals.ts b/frontend/src/utils/conditionals.ts
index 8fae4f0..28f4bd4 100644
--- a/frontend/src/utils/conditionals.ts
+++ b/frontend/src/utils/conditionals.ts
@@ -4,7 +4,8 @@ import {
Condition,
Actions,
} from "@/types/conditional-render.types";
-import { FormField } from "@/types/formfield";
+import { FormField, Fieldtype } from "@/types/formfield";
+import { getFieldTypeDef } from "@/config/fieldTypes";
/**
* Parse conditional_logic string into ConditionalLogic object
@@ -35,13 +36,14 @@ function getFieldValue(
return null;
}
- // Handle boolean/switch fields
- if (fieldType === "Switch" || fieldType === "Checkbox") {
+ const typeDef = getFieldTypeDef(fieldType as Fieldtype);
+
+ if (typeDef?.isBoolean) {
return Boolean(fieldValue);
}
// Handle number fields
- if (fieldType === "Number") {
+ if (fieldType === Fieldtype.NUMBER) {
const num = Number(fieldValue);
return isNaN(num) ? null : num;
}
diff --git a/frontend/src/utils/form_fields.ts b/frontend/src/utils/form_fields.ts
index c4e6eec..13cf2e7 100644
--- a/frontend/src/utils/form_fields.ts
+++ b/frontend/src/utils/form_fields.ts
@@ -1,229 +1,57 @@
import {
- Checkbox,
- FormControl,
- DatePicker,
- DateRangePicker,
- DateTimePicker,
- Rating,
- Select,
- Switch,
- Textarea,
- TextEditor,
- TimePicker,
- Password,
-} from "frappe-ui";
-import { Component } from "vue";
-import Attachment from "@/components/fields/Attachment.vue";
-import Phone from "@/components/fields/Phone.vue";
-import Table from "@/components/fields/Table.vue";
-
+ FIELD_TYPE_DEFINITIONS,
+ FIELD_TYPE_MAP,
+ getFieldTypeDef,
+} from "@/config/fieldTypes";
+import type { FieldTypeDefinition } from "@/config/fieldTypes";
+import { Fieldtype } from "@/types/FormsPro/form_field.types";
+import type { Component } from "vue";
+
+// Re-export the registry under the names the rest of the codebase uses
+export {
+ FIELD_TYPE_DEFINITIONS as formFields,
+ getFieldTypeDef,
+ FIELD_TYPE_MAP,
+};
+export type { FieldTypeDefinition as FormFields };
+
+// Subset type used by RenderField.vue
export type FormFieldType = {
component: Component;
- props: Record;
-};
-
-export type FormFields = FormFieldType & {
- name: string;
-};
-
-// Individual form field components as dictionaries
-
-export const AttachmentField: FormFieldType = {
- component: Attachment,
- props: {
- variant: "outline",
- filetypes: ["image/*", ".jpg", ".gif", ".pdf"],
- },
-};
-
-export const DataField: FormFieldType = {
- component: FormControl,
- props: { type: "text", variant: "outline" },
-};
-
-export const NumberField: FormFieldType = {
- component: FormControl,
- props: { type: "number", variant: "outline" },
-};
-
-export const EmailField: FormFieldType = {
- component: FormControl,
- props: { type: "email", variant: "outline" },
-};
-
-export const DateField: FormFieldType = {
- component: DatePicker,
- props: {
- variant: "outline",
- clearable: true,
- format: "D MMM YYYY",
- },
-};
-
-export const DateTimeField: FormFieldType = {
- component: DateTimePicker,
- props: {
- format: "DD MMM YYYY, hh:mm A",
- clearable: true,
- variant: "outline",
- },
-};
-
-export const DateRangeField: FormFieldType = {
- component: DateRangePicker,
- props: {
- clearable: true,
- variant: "outline",
- format: "DD MMM 'YY",
- },
-};
-
-export const TimeField: FormFieldType = {
- component: TimePicker,
- props: {
- variant: "outline",
- use12Hour: true,
- clearable: true,
- },
-};
-
-export const PasswordField: FormFieldType = {
- component: Password,
- props: {
- variant: "outline",
- },
-};
-
-export const RatingField: FormFieldType = {
- component: Rating,
- props: {},
-};
-
-export const SelectField: FormFieldType = {
- component: Select,
- props: {
- variant: "outline",
- },
-};
-
-export const SwitchField: FormFieldType = {
- component: Switch,
- props: {},
-};
-
-export const TextareaField: FormFieldType = {
- component: Textarea,
- props: {
- variant: "outline",
- },
-};
-
-export const TextEditorField: FormFieldType = {
- component: TextEditor,
- props: {
- editorClass:
- "bg-surface-white w-full rounded-b form-description border rounded-b min-h-24",
- fixedMenu: true,
- bubbleMenu: true,
- starterkitOptions: {
- heading: {
- levels: [2, 3, 4],
- },
- },
- },
-};
-
-export const CheckboxField: FormFieldType = {
- component: Checkbox,
- props: {},
-};
-
-export const PhoneField: FormFieldType = {
- component: Phone,
- props: {
- variant: "outline",
- },
-};
-
-export const TableField: FormFieldType = {
- component: Table,
- props: {
- options: {
- emptyState: {
- title: "This is a table field",
- description: "Use this field to input a list of items.",
- },
- },
- },
-};
-
-export const formFields: FormFields[] = [
- { name: "Attach", ...AttachmentField },
- { name: "Data", ...DataField },
- { name: "Link", ...SelectField },
- { name: "Number", ...NumberField },
- { name: "Email", ...EmailField },
- { name: "Date", ...DateField },
- { name: "Date Time", ...DateTimeField },
- { name: "Date Range", ...DateRangeField },
- { name: "Time Picker", ...TimeField },
- { name: "Password", ...PasswordField },
- { name: "Rating", ...RatingField },
- { name: "Select", ...SelectField },
- { name: "Switch", ...SwitchField },
- { name: "Textarea", ...TextareaField },
- { name: "Text Editor", ...TextEditorField },
- { name: "Checkbox", ...CheckboxField },
- { name: "Phone", ...PhoneField },
- { name: "Table", ...TableField },
-];
-
-export const mapDoctypeFieldForForm = (fieldtype: string): string => {
- const FIELD_TYPE_MAP = {
- Autocomplete: "Data",
- Attach: "Attach",
- "Attach Image": "Attach",
- Barcode: "Barcode",
- Button: "Button",
- Check: "Checkbox",
- Code: "Code",
- Color: "Color",
- "Column Break": "Column Break",
- Currency: "Number",
- Data: "Data",
- Date: "Date",
- Datetime: "Date Time",
- Duration: "Duration",
- "Dynamic Link": "Dynamic Link",
- Float: "Number",
- Fold: "Fold",
- Geolocation: "Geolocation",
- Heading: "Heading",
- HTML: "HTML",
- "HTML Editor": "Text Editor",
- Icon: "Icon",
- Image: "Image",
- Int: "Number",
- JSON: "JSON",
- Link: "Link",
- "Long Text": "Textarea",
- "Markdown Editor": "Text Editor",
- Password: "Password",
- Percent: "Number",
- Phone: "Phone",
- "Read Only": "Read Only",
- Rating: "Rating",
- "Section Break": "Section Break",
- Select: "Select",
- Signature: "Signature",
- "Small Text": "Textarea",
- "Tab Break": "Tab Break",
- Table: "Table",
- "Table MultiSelect": "Table MultiSelect",
- Text: "Textarea",
- "Text Editor": "Text Editor",
- Time: "Time",
+ props: Record;
+};
+
+// Maps Frappe DocType fieldtypes to the equivalent Forms Pro fieldtype.
+// Used when importing fields from an existing DocType into a form.
+export const mapDoctypeFieldForForm = (
+ fieldtype: string
+): string | undefined => {
+ const FRAPPE_TO_FORM_TYPE: Partial> = {
+ Autocomplete: Fieldtype.DATA,
+ Attach: Fieldtype.ATTACH,
+ "Attach Image": Fieldtype.ATTACH,
+ Check: Fieldtype.CHECKBOX,
+ Currency: Fieldtype.NUMBER,
+ Data: Fieldtype.DATA,
+ Date: Fieldtype.DATE,
+ Datetime: Fieldtype.DATE_TIME,
+ Float: Fieldtype.NUMBER,
+ "HTML Editor": Fieldtype.TEXT_EDITOR,
+ Int: Fieldtype.NUMBER,
+ Link: Fieldtype.LINK,
+ "Long Text": Fieldtype.TEXTAREA,
+ "Markdown Editor": Fieldtype.TEXT_EDITOR,
+ Password: Fieldtype.PASSWORD,
+ Percent: Fieldtype.NUMBER,
+ Phone: Fieldtype.PHONE,
+ Rating: Fieldtype.RATING,
+ Select: Fieldtype.SELECT,
+ "Small Text": Fieldtype.TEXTAREA,
+ Table: Fieldtype.TABLE,
+ Text: Fieldtype.TEXTAREA,
+ "Text Editor": Fieldtype.TEXT_EDITOR,
+ Time: Fieldtype.TIME_PICKER,
};
- return FIELD_TYPE_MAP[fieldtype as keyof typeof FIELD_TYPE_MAP];
+ return FRAPPE_TO_FORM_TYPE[fieldtype];
};