1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00

Update autoscreens to have new container props

This commit is contained in:
Andrew Kingston 2021-06-10 09:48:08 +01:00
parent c17550d0c6
commit c412af8766
8 changed files with 34 additions and 31 deletions

View file

@ -6,9 +6,5 @@ export default {
}
const createScreen = () => {
return new Screen()
.mainType("div")
.component("@budibase/standard-components/container")
.instanceName("New Screen")
.json()
return new Screen().instanceName("New Screen").json()
}

View file

@ -28,7 +28,6 @@ function generateTitleContainer(table, formId) {
const createScreen = table => {
const screen = new Screen()
.component("@budibase/standard-components/container")
.instanceName(`${table.name} - New`)
.route(newRowUrl(table))

View file

@ -149,7 +149,6 @@ const createScreen = table => {
provider.addChild(repeater)
return new Screen()
.component("@budibase/standard-components/container")
.instanceName(`${table.name} - Detail`)
.route(rowDetailUrl(table))
.addChild(provider)

View file

@ -56,14 +56,15 @@ function generateTitleContainer(table) {
.text(table.name)
return new Component("@budibase/standard-components/container")
.type("div")
.normalStyle({
display: "flex",
"flex-direction": "row",
"justify-content": "space-between",
"align-items": "center",
"margin-bottom": "32px",
})
.customProps({
direction: "row",
hAlign: "stretch",
vAlign: "middle",
size: "shrink",
})
.instanceName("Title Container")
.addChild(heading)
.addChild(newButton)
@ -137,13 +138,17 @@ const createScreen = table => {
"padding-left": "48px",
"margin-bottom": "20px",
})
.type("div")
.customProps({
direction: "column",
hAlign: "stretch",
vAlign: "top",
size: "shrink",
})
.instanceName("Container")
.addChild(generateTitleContainer(table))
.addChild(provider)
return new Screen()
.component("@budibase/standard-components/container")
.route(rowListUrl(table))
.instanceName(`${table.name} - List`)
.addChild(mainContainer)

View file

@ -8,7 +8,7 @@ export class Screen extends BaseStructure {
layoutId: "layout_private_master",
props: {
_id: uuid(),
_component: "",
_component: "@budibase/standard-components/container",
_styles: {
normal: {},
hover: {},
@ -17,6 +17,10 @@ export class Screen extends BaseStructure {
},
_children: [],
_instanceName: "",
direction: "column",
hAlign: "stretch",
vAlign: "top",
size: "grow",
},
routing: {
route: "",
@ -41,11 +45,6 @@ export class Screen extends BaseStructure {
return this
}
mainType(type) {
this._json.type = type
return this
}
route(route) {
this._json.routing.route = route
return this

View file

@ -35,7 +35,6 @@ export function makeLinkComponent(tableName) {
export function makeMainForm() {
return new Component("@budibase/standard-components/form")
.type("div")
.normalStyle({
width: "700px",
padding: "0px",
@ -79,11 +78,16 @@ export function makeBreadcrumbContainer(tableName, text, capitalise = false) {
.instanceName("Identifier")
return new Component("@budibase/standard-components/container")
.type("div")
.normalStyle({
"font-size": "14px",
color: "#757575",
})
.customProps({
direction: "row",
hAlign: "left",
vAlign: "middle",
size: "shrink",
})
.instanceName("Breadcrumbs")
.addChild(link)
.addChild(arrowText)
@ -149,15 +153,16 @@ export function makeTitleContainer(title) {
.text(title)
return new Component("@budibase/standard-components/container")
.type("div")
.normalStyle({
display: "flex",
"flex-direction": "row",
"justify-content": "space-between",
"align-items": "center",
"margin-top": "32px",
"margin-bottom": "32px",
})
.customProps({
direction: "row",
hAlign: "stretch",
vAlign: "middle",
size: "shrink",
})
.instanceName("Title Container")
.addChild(heading)
}

View file

@ -39,8 +39,8 @@
"barIcon": "AlignLeft"
},
{
"label": "Middle",
"value": "middle",
"label": "Center",
"value": "center",
"barIcon": "AlignCenter"
},
{

View file

@ -56,7 +56,7 @@
.direction-column.vAlign-top {
justify-content: flex-start;
}
.direction-row.hAlign-middle,
.direction-row.hAlign-center,
.direction-column.vAlign-middle {
justify-content: center;
}
@ -74,7 +74,7 @@
align-items: flex-start;
}
.direction-row.vAlign-middle,
.direction-column.hAlign-middle {
.direction-column.hAlign-center {
align-items: center;
}
.direction-row.vAlign-bottom,