Skip to content

Commit

Permalink
Merge pull request #145 from libvue/fix/dialog
Browse files Browse the repository at this point in the history
Fix/dialog
  • Loading branch information
harmendv authored Dec 22, 2023
2 parents 6294e8a + 8c6bd2d commit 09b56e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@libvue/core",
"version": "1.1.0",
"version": "1.1.1",
"private": false,
"scripts": {
"dev": "vite",
Expand Down
40 changes: 22 additions & 18 deletions src/lib/components/LvDialog/LvDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div v-if="show" class="lv-dialog__backdrop" @click="onClickBackdrop"></div>
</transition>
<transition name="fade-slide-up" appear>
<div v-if="show" ref="content" class="lv-dialog__window" :style="windowStyleObject">
<div v-if="show" ref="content" class="lv-dialog__window">
<slot name="default">
<div v-if="!!$slots.header" class="lv-dialog__header"><slot name="header"></slot></div>
<div v-if="!!$slots.content" class="lv-dialog__content"><slot name="content"></slot></div>
Expand Down Expand Up @@ -67,6 +67,10 @@ export default {
type: String,
default: '900px'
},
overflowY: {
type: String,
default: 'auto',
},
fullscreen: {
type: Boolean,
default: false,
Expand Down Expand Up @@ -97,29 +101,27 @@ export default {
fallbackFocus: document.body,
};
},
windowStyleObject() {
return {
'maxWidth': this.maxWidth,
}
},
classObject() {
return {
'lv-dialog--fullscreen': this.fullscreen,
};
}
},
watch: {
show(val) {
this.isLocked = !!val;
// If invisible, directly show
// Otherwise hide with a delay
if (val) {
this.computedShow = true;
} else {
setTimeout(() => {
this.computedShow = false;
}, this.cssTimeToMilliSeconds(this.timeDouble));
}
show: {
handler(val) {
this.isLocked = !!val;
// If invisible, directly show
// Otherwise hide with a delay
if (val) {
this.computedShow = true;
} else {
setTimeout(() => {
this.computedShow = false;
}, this.cssTimeToMilliSeconds(this.timeDouble));
}
},
immediate: true,
},
},
mounted() {
Expand Down Expand Up @@ -165,11 +167,12 @@ export default {
max-height: 100%;
display: flex;
flex-direction: column;
max-width: v-bind(maxWidth);
}
#{$self}__content {
flex-shrink: 1;
overflow-y: auto;
overflow-y: v-bind(overflowY);
}
#{$self}__footer {
padding-top: 1rem;
Expand All @@ -185,6 +188,7 @@ export default {
}
#{$self}__content {
flex-grow: 1;
overflow-y: auto;
}
}
}
Expand Down

0 comments on commit 09b56e1

Please sign in to comment.