From 10ba7e4da14d5e6464afd5dec3f2d519afb5617c Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Thu, 31 Jan 2019 18:42:58 +0300 Subject: [PATCH] Initated OverlayPanel --- src/AppMenu.vue | 1 + src/assets/styles/primevue.css | 1 + src/components/dialog/Dialog.vue | 4 +- src/components/overlaypanel/OverlayPanel.css | 52 ++++++++++++ src/components/overlaypanel/OverlayPanel.vue | 85 ++++++++++++++++++++ src/main.js | 2 + src/router.js | 5 ++ src/views/overlaypanel/OverlayPanelDemo.vue | 28 +++++++ 8 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 src/components/overlaypanel/OverlayPanel.css create mode 100644 src/components/overlaypanel/OverlayPanel.vue create mode 100644 src/views/overlaypanel/OverlayPanelDemo.vue diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 8838527a3..6095d8b39 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -77,6 +77,7 @@
● Dialog + ● OverlayPanel
diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index 7c6aa67ac..65c64f429 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -12,6 +12,7 @@ @import '../../components/inputswitch/InputSwitch.css'; @import '../../components/listbox/Listbox.css'; @import '../../components/multiselect/MultiSelect.css'; +@import '../../components/overlaypanel/OverlayPanel.css'; @import '../../components/panel/Panel.css'; @import '../../components/password/Password.css'; @import '../../components/progressbar/ProgressBar.css'; diff --git a/src/components/dialog/Dialog.vue b/src/components/dialog/Dialog.vue index a5298da8d..420a0dcc4 100644 --- a/src/components/dialog/Dialog.vue +++ b/src/components/dialog/Dialog.vue @@ -47,11 +47,11 @@ export default { autoZIndex: { type: Boolean, default: true - }, + } }, mask: null, methods: { - close(event) { + close() { this.$emit('update:visible', false); }, onEnter() { diff --git a/src/components/overlaypanel/OverlayPanel.css b/src/components/overlaypanel/OverlayPanel.css new file mode 100644 index 000000000..fa414c7c7 --- /dev/null +++ b/src/components/overlaypanel/OverlayPanel.css @@ -0,0 +1,52 @@ +.p-overlaypanel { + padding: 0; + margin: 0; + position: absolute; +} + +.p-overlaypanel-content { + padding: 0.5em 1em; +} + +.p-overlaypanel-close { + position: absolute; + top: -1em; + right: -1em; + width: 2em; + height: 2em; + line-height: 2em; + text-align: center; + -moz-border-radius: 100%; + -webkit-border-radius: 100%; + border-radius: 100%; +} + +.p-overlaypanel-close-icon { + line-height: inherit; +} + +/* Animation */ +.p-overlaypanel-enter, +.p-overlaypanel-leave-to { + opacity: 0; + transform: translate3d(-50%, -25%, 0) scale(0.9); +} + +.p-overlaypanel-enter-active, +.p-overlaypanel-leave-active { + transition: all 400ms cubic-bezier(0.25, 0.8, 0.25, 1); +} + +.p-overlaypanel-enter, +.p-overlaypanel-leave-to { + opacity: 0; + -webkit-transform: translateY(5%); + -ms-transform: translateY(5%); + transform: translateY(5%); +} + +.p-overlaypanel-enter-active, +.p-overlaypanel-leave-active { + -webkit-transition: transform .3s, opacity .15s; + transition: transform .3s, opacity .15s; +} \ No newline at end of file diff --git a/src/components/overlaypanel/OverlayPanel.vue b/src/components/overlaypanel/OverlayPanel.vue new file mode 100644 index 000000000..5001389ac --- /dev/null +++ b/src/components/overlaypanel/OverlayPanel.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/main.js b/src/main.js index 8a5e13233..ee0ea975e 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,7 @@ import InputText from './components/inputtext/InputText'; import Fieldset from './components/fieldset/Fieldset'; import MultiSelect from './components/multiselect/MultiSelect'; import Listbox from './components/listbox/Listbox'; +import OverlayPanel from './components/overlaypanel/OverlayPanel'; import Panel from './components/panel/Panel'; import Password from './components/password/Password'; import ProgressBar from './components/progressbar/ProgressBar'; @@ -56,6 +57,7 @@ Vue.component('InputText', InputText); Vue.component('Listbox', Listbox); Vue.component('Fieldset', Fieldset); Vue.component('MultiSelect', MultiSelect); +Vue.component('OverlayPanel', OverlayPanel); Vue.component('Panel', Panel); Vue.component('Password', Password); Vue.component('ProgressBar', ProgressBar); diff --git a/src/router.js b/src/router.js index ca80fa28c..20650e234 100644 --- a/src/router.js +++ b/src/router.js @@ -136,6 +136,11 @@ export default new Router({ name: 'multiselect', component: () => import('./views/multiselect/MultiSelectDemo.vue') }, + { + path: '/overlaypanel', + name: 'overlaypanel', + component: () => import('./views/overlaypanel/OverlayPanelDemo.vue') + }, { path: '/panel', name: 'panel', diff --git a/src/views/overlaypanel/OverlayPanelDemo.vue b/src/views/overlaypanel/OverlayPanelDemo.vue new file mode 100644 index 000000000..017b5c763 --- /dev/null +++ b/src/views/overlaypanel/OverlayPanelDemo.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file