diff --git a/docs/app/pages/Components/Dialog/Dialog.vue b/docs/app/pages/Components/Dialog/Dialog.vue index d18f5316e..ade06deed 100644 --- a/docs/app/pages/Components/Dialog/Dialog.vue +++ b/docs/app/pages/Components/Dialog/Dialog.vue @@ -9,8 +9,10 @@

Dialogs informs users about a specific task and may contain critical information, require decisions, or involve multiple tasks. The dialog component works with any plain html content. You can have tabs inside, all form components and many more.

The component can be used with a custom markup, using the auxiliary components or with presets made by Vue Material. Those presets emulates the default Dialogs from Javascript, like confirm, alert and prompt.

- To allow scrolling in content of modal you need to wrap your content in md-dialog-content component. - + + To allow scrolling in content of modal you need to wrap your content in + md-dialog-content component. +

Dialog

@@ -67,218 +69,230 @@ diff --git a/src/components/MdDialog/MdDialog.vue b/src/components/MdDialog/MdDialog.vue index e78058042..9ca989891 100644 --- a/src/components/MdDialog/MdDialog.vue +++ b/src/components/MdDialog/MdDialog.vue @@ -1,13 +1,24 @@ + @import "~components/MdAnimation/variables"; + @import "~components/MdLayout/mixins"; + @import "~components/MdElevation/mixins"; + + $opacity-transition-duration: 0.15s; + $transform-transition-duration: 0.2s; + $max-duration: max( + $opacity-transition-duration, + $transform-transition-duration + ); + + .md-dialog { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + align-items: center; + justify-content: center; + pointer-events: none; + display: flex; + transition-duration: $max-duration; + z-index: 110; + + &.with-target { + position: absolute; + } + + &.md-dialog-leave, + &.md-dialog-enter-to { + .md-dialog-container { + opacity: 1; + transform: scale(1); + } + + .md-dialog-fullscreen { + @include md-layout-xsmall { + opacity: 0; + transform: translate(0, 30%); + } + } + } + + &.md-dialog-enter, + &.md-dialog-leave-to { + .md-dialog-container { + opacity: 0; + transform: scale(0.9); + } + + .md-dialog-fullscreen { + @include md-layout-xsmall { + opacity: 1; + transform: translate(0, 0); + } + } + } + } + + .md-dialog-container { + @include md-elevation(24); + min-width: 280px; + max-width: 80%; + max-height: 80%; + margin: auto; + display: flex; + flex-flow: column; + overflow: hidden; + border-radius: 2px; + backface-visibility: hidden; + pointer-events: auto; + opacity: 1; + transform-origin: center center; + transition: opacity $opacity-transition-duration $md-transition-stand-timing, + transform $transform-transition-duration $md-transition-stand-timing; + will-change: opacity, transform; + + &.md-dialog-leave, + &.md-dialog-enter-to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + + &.md-dialog-enter, + &.md-dialog-leave-to { + opacity: 0; + transform: translate(-50%, -50%) scale(0.9); + } + } + + .md-dialog-container { + .md-tabs { + flex: 1; + max-width: 100%; + } + + .md-tabs-navigation { + padding: 0 12px; + } + + .md-tab { + @include md-layout-xsmall { + padding: 12px; + } + } + } + + .md-dialog-fullscreen { + @include md-layout-xsmall { + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + border-radius: 0; + transform: none; + + &.md-dialog-enter, + &.md-dialog-leave-to { + opacity: 0; + transform: translate3D(0, 30%, 0); + } + + &.md-dialog-leave, + &.md-dialog-enter-to { + opacity: 1; + transform: translate3D(0, 0, 0); + } + } + } + \ No newline at end of file diff --git a/src/components/MdDialog/MdDialogActions.vue b/src/components/MdDialog/MdDialogActions.vue index 5ac3411a7..ceaacbddf 100644 --- a/src/components/MdDialog/MdDialogActions.vue +++ b/src/components/MdDialog/MdDialogActions.vue @@ -5,9 +5,9 @@