budibase/packages/builder/src/constants/backend/index.js

78 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-06-15 17:41:31 +02:00
export const FIELDS = {
2020-08-07 17:13:57 +02:00
STRING: {
2020-06-15 17:41:31 +02:00
name: "Plain Text",
icon: "ri-text",
2020-06-16 21:29:18 +02:00
type: "string",
constraints: {
2020-06-15 17:41:31 +02:00
type: "string",
2020-06-16 21:29:18 +02:00
length: {},
2020-07-19 18:21:52 +02:00
presence: { allowEmpty: true },
2020-06-15 17:41:31 +02:00
},
},
NUMBER: {
name: "Number",
icon: "ri-number-1",
2020-06-16 21:29:18 +02:00
type: "number",
constraints: {
2020-06-15 17:41:31 +02:00
type: "number",
2020-07-19 18:21:52 +02:00
presence: { allowEmpty: true },
numericality: { greaterThanOrEqualTo: "", lessThanOrEqualTo: "" },
2020-06-15 17:41:31 +02:00
},
},
BOOLEAN: {
name: "True/False",
icon: "ri-toggle-line",
2020-06-16 21:29:18 +02:00
type: "boolean",
constraints: {
2020-06-15 17:41:31 +02:00
type: "boolean",
2020-07-19 18:21:52 +02:00
presence: { allowEmpty: true },
2020-06-15 17:41:31 +02:00
},
},
2020-06-22 22:30:23 +02:00
// OPTIONS: {
// name: "Options",
// icon: "ri-list-check-2",
// type: "options",
// constraints: {
// type: "string",
2020-07-19 18:21:52 +02:00
// presence: { allowEmpty: true },
2020-06-22 22:30:23 +02:00
// },
// },
DATETIME: {
name: "Date/Time",
icon: "ri-calendar-event-fill",
type: "datetime",
constraints: {
type: "string",
length: {},
presence: { allowEmpty: true },
datetime: {
latest: "",
earliest: "",
},
},
},
2020-09-11 16:09:56 +02:00
ATTACHMENT: {
name: "Attachment",
icon: "ri-file-line",
type: "attachment",
constraints: {
type: "array",
presence: { allowEmpty: true },
},
},
2020-08-10 16:34:37 +02:00
// LINKED_FIELDS: {
// name: "Linked Fields",
// icon: "ri-link",
// type: "link",
// modelId: null,
// constraints: {
// type: "array",
// },
// },
2020-06-15 17:41:31 +02:00
}
2020-09-17 13:45:28 +02:00
export const FILE_TYPES = {
IMAGE: ["png", "tiff", "gif", "raw", "jpg", "jpeg"],
CODE: ["js", "rs", "py", "java", "rb", "hs", "yml"],
DOCUMENT: ["odf", "docx", "doc", "pdf", "csv"]
}