Skip to content

Commit

Permalink
Improve UI/UX for Modal view
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed May 22, 2024
1 parent d69c205 commit ea4cf1f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 36 deletions.
2 changes: 1 addition & 1 deletion assets/vendor/manager/dist/index.html

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions assets/vendor/manager/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/vendor/manager/index.html

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions assets/vendor/manager/src/components/helpers/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ function checkShow(field) {
}
return true;
}
function checkShowGroup(fields) {
let hasField = false;
if (fields.length) {
fields.forEach(field => {
if (typeof field.ngShow === 'string' && checkShow(field)) {
hasField = true;
return hasField;
}
});
}
return hasField;
}
function saveModal(){
let allowSave = true;
if (subFormOpen.value.value) {
Expand Down Expand Up @@ -75,9 +87,9 @@ function sidebarClick(id) {
<div class="tab-content modal-body" :id="`modal-tab-content-`+props.element.id">
<div v-for="(fieldset, idx) in form.content" :key="fieldset.name" class="tab-pane fade" :class="{'show active' : idx === 0}" :id="fieldset.name+`-tab-pane-`+props.element.id" role="tabpanel" :aria-labelledby="fieldset.name+`-tab`" tabindex="0">
<nav v-if="Object.keys(fieldset.childs).length > 3" class="nav nav-pills d-none d-xl-block flex-column position-fixed overflow-hidden top-50 start-0 translate-middle-y rounded-end-4">
<a v-for="(group, gid) in fieldset.childs" :key="gid" class="nav-link bg-body-tertiary rounded-0" @click.prevent="sidebarClick(`group-`+gid+`-`+props.element.id)" href="#" :class="{'d-none' : gid === 'none' || group.title === ''}">{{ group.title }}</a>
<a v-for="(group, gid) in fieldset.childs" :key="gid" class="nav-link bg-body-tertiary rounded-0" v-show="checkShowGroup(group.fields)" @click.prevent="sidebarClick(`group-`+gid+`-`+props.element.id)" href="#" :class="{'d-none' : gid === 'none' || group.title === ''}">{{ group.title }}</a>
</nav>
<div v-for="(group, gid) in fieldset.childs" :key="gid" :class="`group-`+gid" :id="`group-`+gid+`-`+props.element.id">
<div v-for="(group, gid) in fieldset.childs" :key="gid" :class="`group-`+gid" :id="`group-`+gid+`-`+props.element.id" v-show="checkShowGroup(group.fields)">
<div v-if="group.title || group.description" class="heading-group mb-4">
<h5 v-if="group.title" class="astroid-heading-line"><span>{{ group.title }}</span></h5>
<p v-if="group.description" class="form-text">{{ group.description }}</p>
Expand Down

0 comments on commit ea4cf1f

Please sign in to comment.