Update autoscreens to have new container props
This commit is contained in:
parent
bb473c53f7
commit
2124c85a09
|
@ -6,9 +6,5 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const createScreen = () => {
|
const createScreen = () => {
|
||||||
return new Screen()
|
return new Screen().instanceName("New Screen").json()
|
||||||
.mainType("div")
|
|
||||||
.component("@budibase/standard-components/container")
|
|
||||||
.instanceName("New Screen")
|
|
||||||
.json()
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ function generateTitleContainer(table, formId) {
|
||||||
|
|
||||||
const createScreen = table => {
|
const createScreen = table => {
|
||||||
const screen = new Screen()
|
const screen = new Screen()
|
||||||
.component("@budibase/standard-components/container")
|
|
||||||
.instanceName(`${table.name} - New`)
|
.instanceName(`${table.name} - New`)
|
||||||
.route(newRowUrl(table))
|
.route(newRowUrl(table))
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,6 @@ const createScreen = table => {
|
||||||
provider.addChild(repeater)
|
provider.addChild(repeater)
|
||||||
|
|
||||||
return new Screen()
|
return new Screen()
|
||||||
.component("@budibase/standard-components/container")
|
|
||||||
.instanceName(`${table.name} - Detail`)
|
.instanceName(`${table.name} - Detail`)
|
||||||
.route(rowDetailUrl(table))
|
.route(rowDetailUrl(table))
|
||||||
.addChild(provider)
|
.addChild(provider)
|
||||||
|
|
|
@ -56,14 +56,15 @@ function generateTitleContainer(table) {
|
||||||
.text(table.name)
|
.text(table.name)
|
||||||
|
|
||||||
return new Component("@budibase/standard-components/container")
|
return new Component("@budibase/standard-components/container")
|
||||||
.type("div")
|
|
||||||
.normalStyle({
|
.normalStyle({
|
||||||
display: "flex",
|
|
||||||
"flex-direction": "row",
|
|
||||||
"justify-content": "space-between",
|
|
||||||
"align-items": "center",
|
|
||||||
"margin-bottom": "32px",
|
"margin-bottom": "32px",
|
||||||
})
|
})
|
||||||
|
.customProps({
|
||||||
|
direction: "row",
|
||||||
|
hAlign: "stretch",
|
||||||
|
vAlign: "middle",
|
||||||
|
size: "shrink",
|
||||||
|
})
|
||||||
.instanceName("Title Container")
|
.instanceName("Title Container")
|
||||||
.addChild(heading)
|
.addChild(heading)
|
||||||
.addChild(newButton)
|
.addChild(newButton)
|
||||||
|
@ -137,13 +138,17 @@ const createScreen = table => {
|
||||||
"padding-left": "48px",
|
"padding-left": "48px",
|
||||||
"margin-bottom": "20px",
|
"margin-bottom": "20px",
|
||||||
})
|
})
|
||||||
.type("div")
|
.customProps({
|
||||||
|
direction: "column",
|
||||||
|
hAlign: "stretch",
|
||||||
|
vAlign: "top",
|
||||||
|
size: "shrink",
|
||||||
|
})
|
||||||
.instanceName("Container")
|
.instanceName("Container")
|
||||||
.addChild(generateTitleContainer(table))
|
.addChild(generateTitleContainer(table))
|
||||||
.addChild(provider)
|
.addChild(provider)
|
||||||
|
|
||||||
return new Screen()
|
return new Screen()
|
||||||
.component("@budibase/standard-components/container")
|
|
||||||
.route(rowListUrl(table))
|
.route(rowListUrl(table))
|
||||||
.instanceName(`${table.name} - List`)
|
.instanceName(`${table.name} - List`)
|
||||||
.addChild(mainContainer)
|
.addChild(mainContainer)
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class Screen extends BaseStructure {
|
||||||
layoutId: "layout_private_master",
|
layoutId: "layout_private_master",
|
||||||
props: {
|
props: {
|
||||||
_id: uuid(),
|
_id: uuid(),
|
||||||
_component: "",
|
_component: "@budibase/standard-components/container",
|
||||||
_styles: {
|
_styles: {
|
||||||
normal: {},
|
normal: {},
|
||||||
hover: {},
|
hover: {},
|
||||||
|
@ -17,6 +17,10 @@ export class Screen extends BaseStructure {
|
||||||
},
|
},
|
||||||
_children: [],
|
_children: [],
|
||||||
_instanceName: "",
|
_instanceName: "",
|
||||||
|
direction: "column",
|
||||||
|
hAlign: "stretch",
|
||||||
|
vAlign: "top",
|
||||||
|
size: "grow",
|
||||||
},
|
},
|
||||||
routing: {
|
routing: {
|
||||||
route: "",
|
route: "",
|
||||||
|
@ -41,11 +45,6 @@ export class Screen extends BaseStructure {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
mainType(type) {
|
|
||||||
this._json.type = type
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
route(route) {
|
route(route) {
|
||||||
this._json.routing.route = route
|
this._json.routing.route = route
|
||||||
return this
|
return this
|
||||||
|
|
|
@ -35,7 +35,6 @@ export function makeLinkComponent(tableName) {
|
||||||
|
|
||||||
export function makeMainForm() {
|
export function makeMainForm() {
|
||||||
return new Component("@budibase/standard-components/form")
|
return new Component("@budibase/standard-components/form")
|
||||||
.type("div")
|
|
||||||
.normalStyle({
|
.normalStyle({
|
||||||
width: "700px",
|
width: "700px",
|
||||||
padding: "0px",
|
padding: "0px",
|
||||||
|
@ -79,11 +78,16 @@ export function makeBreadcrumbContainer(tableName, text, capitalise = false) {
|
||||||
.instanceName("Identifier")
|
.instanceName("Identifier")
|
||||||
|
|
||||||
return new Component("@budibase/standard-components/container")
|
return new Component("@budibase/standard-components/container")
|
||||||
.type("div")
|
|
||||||
.normalStyle({
|
.normalStyle({
|
||||||
"font-size": "14px",
|
"font-size": "14px",
|
||||||
color: "#757575",
|
color: "#757575",
|
||||||
})
|
})
|
||||||
|
.customProps({
|
||||||
|
direction: "row",
|
||||||
|
hAlign: "left",
|
||||||
|
vAlign: "middle",
|
||||||
|
size: "shrink",
|
||||||
|
})
|
||||||
.instanceName("Breadcrumbs")
|
.instanceName("Breadcrumbs")
|
||||||
.addChild(link)
|
.addChild(link)
|
||||||
.addChild(arrowText)
|
.addChild(arrowText)
|
||||||
|
@ -149,15 +153,16 @@ export function makeTitleContainer(title) {
|
||||||
.text(title)
|
.text(title)
|
||||||
|
|
||||||
return new Component("@budibase/standard-components/container")
|
return new Component("@budibase/standard-components/container")
|
||||||
.type("div")
|
|
||||||
.normalStyle({
|
.normalStyle({
|
||||||
display: "flex",
|
|
||||||
"flex-direction": "row",
|
|
||||||
"justify-content": "space-between",
|
|
||||||
"align-items": "center",
|
|
||||||
"margin-top": "32px",
|
"margin-top": "32px",
|
||||||
"margin-bottom": "32px",
|
"margin-bottom": "32px",
|
||||||
})
|
})
|
||||||
|
.customProps({
|
||||||
|
direction: "row",
|
||||||
|
hAlign: "stretch",
|
||||||
|
vAlign: "middle",
|
||||||
|
size: "shrink",
|
||||||
|
})
|
||||||
.instanceName("Title Container")
|
.instanceName("Title Container")
|
||||||
.addChild(heading)
|
.addChild(heading)
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
"barIcon": "AlignLeft"
|
"barIcon": "AlignLeft"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Middle",
|
"label": "Center",
|
||||||
"value": "middle",
|
"value": "center",
|
||||||
"barIcon": "AlignCenter"
|
"barIcon": "AlignCenter"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
.direction-column.vAlign-top {
|
.direction-column.vAlign-top {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
}
|
}
|
||||||
.direction-row.hAlign-middle,
|
.direction-row.hAlign-center,
|
||||||
.direction-column.vAlign-middle {
|
.direction-column.vAlign-middle {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
.direction-row.vAlign-middle,
|
.direction-row.vAlign-middle,
|
||||||
.direction-column.hAlign-middle {
|
.direction-column.hAlign-center {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.direction-row.vAlign-bottom,
|
.direction-row.vAlign-bottom,
|
||||||
|
|
Loading…
Reference in New Issue