Skip to content

Commit

Permalink
Adjust fields when opening the registration navigation (#927)
Browse files Browse the repository at this point in the history
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
  • Loading branch information
elsiosanchez and elsiosanchez authored Jun 18, 2021
1 parent 2247f81 commit 17509c8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
44 changes: 37 additions & 7 deletions src/components/ADempiere/Field/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<el-col
v-if="isDisplayedField"
key="is-panel-template"
:xs="24"
:sm="12"
:md="8"
:lg="8"
:xl="8"
:xs="sizeField.xs"
:sm="sizeField.sm"
:md="sizeField.md"
:lg="sizeField.lg"
:xl="sizeField.xl"
:class="classField"
>
<el-form-item>
<el-form-item :class="classFrom">
<template slot="label">
<field-options
:metadata="fieldAttributes"
Expand Down Expand Up @@ -103,6 +103,30 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
classFrom() {
if (this.field.componentPath === 'FieldTextLong' || this.field.componentPath === 'FieldImage') {
return 'from-text-long'
}
return 'from-field'
},
sizeField() {
if (this.field.isShowedRecordNavigation) {
return {
xs: this.field.size.xs,
sm: this.field.size.sm * 2,
md: this.field.size.md * 2,
lg: this.field.size.lg * 2,
xl: this.field.size.xl * 2
}
}
return {
xs: this.field.size.xs,
sm: this.field.size.sm,
md: this.field.size.md,
lg: this.field.size.lg,
xl: this.field.size.xl
}
},
// load the component that is indicated in the attributes of received property
componentRender() {
if (this.isEmptyValue(this.field.componentPath || !this.field.isSupported)) {
Expand Down Expand Up @@ -310,10 +334,16 @@ export default {
/**
* Separation between elements (item) of the form
*/
.from-text-long {
max-height: 300px;
min-height: 250px;
}
.from-field {
max-height: 100px;
}
.el-form-item {
margin-bottom: 10px !important;
margin-left: 10px;
// this.field.isShowedRecordNavigation
margin-right: 10px;
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/ADempiere/references.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ export const YES_NO = {
size: {
xs: 14,
sm: 8,
md: 8,
lg: 3,
xl: 6
md: 6,
lg: 6,
xl: 4
}
}

Expand Down

0 comments on commit 17509c8

Please sign in to comment.