This commit is contained in:
Michael Shanks 2020-03-05 14:55:34 +00:00
parent dd1d3643e4
commit 812f60ec77
3 changed files with 11 additions and 10 deletions

View File

@ -17,9 +17,7 @@ const postcssOptions = () => ({
], ],
}) })
const coreExternal = [ const coreExternal = ["shortid"]
"shortid",
]
export default { export default {
input: "src/index.js", input: "src/index.js",

View File

@ -32,10 +32,13 @@ const heading = record => ({
const field = (record, f) => { const field = (record, f) => {
if (f.type === "bool") return checkbox(record, f) if (f.type === "bool") return checkbox(record, f)
if (f.type === "string" if (
&& f.typeOptions f.type === "string" &&
&& f.typeOptions.values f.typeOptions &&
&& f.typeOptions.values.length > 0) return select(record, f) f.typeOptions.values &&
f.typeOptions.values.length > 0
)
return select(record, f)
return textField(record, f) return textField(record, f)
} }
@ -64,8 +67,8 @@ const select = (record, f) => ({
_children: f.typeOptions.values.map(val => ({ _children: f.typeOptions.values.map(val => ({
_component: "@budibase/materialdesign-components/ListItem", _component: "@budibase/materialdesign-components/ListItem",
value: val, value: val,
text: val text: val,
})) })),
}) })
const fieldValueBinding = (record, f) => `state.${record.name}.${f.name}` const fieldValueBinding = (record, f) => `state.${record.name}.${f.name}`

View File

@ -4,7 +4,7 @@ const templateOptions = {
indexes: [ indexes: [
{ {
name: "customers", name: "customers",
nodeKey: () => "/customers" nodeKey: () => "/customers",
}, },
], ],
helpers: { helpers: {