Type renderers
This commit is contained in:
parent
fcda81434c
commit
3d45dcea5f
|
@ -8,6 +8,7 @@
|
|||
"dependencies": {
|
||||
"@budibase/bbui": "0.0.0",
|
||||
"@budibase/shared-core": "0.0.0",
|
||||
"@budibase/types": "0.0.0",
|
||||
"dayjs": "^1.10.8",
|
||||
"lodash": "4.17.21",
|
||||
"socket.io-client": "^4.6.1"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { FieldType } from "@budibase/types"
|
||||
|
||||
import OptionsCell from "../cells/OptionsCell.svelte"
|
||||
import DateCell from "../cells/DateCell.svelte"
|
||||
import MultiSelectCell from "../cells/MultiSelectCell.svelte"
|
||||
|
@ -12,19 +14,19 @@ import AttachmentCell from "../cells/AttachmentCell.svelte"
|
|||
import BBReferenceCell from "../cells/BBReferenceCell.svelte"
|
||||
|
||||
const TypeComponentMap = {
|
||||
text: TextCell,
|
||||
options: OptionsCell,
|
||||
datetime: DateCell,
|
||||
barcodeqr: TextCell,
|
||||
longform: LongFormCell,
|
||||
array: MultiSelectCell,
|
||||
number: NumberCell,
|
||||
boolean: BooleanCell,
|
||||
attachment: AttachmentCell,
|
||||
link: RelationshipCell,
|
||||
formula: FormulaCell,
|
||||
json: JSONCell,
|
||||
bb_reference: BBReferenceCell,
|
||||
[FieldType.STRING]: TextCell,
|
||||
[FieldType.OPTIONS]: OptionsCell,
|
||||
[FieldType.DATETIME]: DateCell,
|
||||
[FieldType.BARCODEQR]: TextCell,
|
||||
[FieldType.LONGFORM]: LongFormCell,
|
||||
[FieldType.ARRAY]: MultiSelectCell,
|
||||
[FieldType.NUMBER]: NumberCell,
|
||||
[FieldType.BOOLEAN]: BooleanCell,
|
||||
[FieldType.ATTACHMENT]: AttachmentCell,
|
||||
[FieldType.LINK]: RelationshipCell,
|
||||
[FieldType.FORMULA]: FormulaCell,
|
||||
[FieldType.JSON]: JSONCell,
|
||||
[FieldType.BB_REFERENCE]: BBReferenceCell,
|
||||
}
|
||||
export const getCellRenderer = column => {
|
||||
return TypeComponentMap[column?.schema?.type] || TextCell
|
||||
|
|
Loading…
Reference in New Issue