From daf223766c6e13c52e9ce1ad16539fb822a32b5e Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Mon, 10 Dec 2018 11:46:14 +0300 Subject: [PATCH] Implemented Fieldset component --- src/AppMenu.vue | 1 + src/assets/styles/primevue.css | 3 +- src/components/fieldset/Fieldset.css | 45 +++++++++++++++++++++++++++ src/components/fieldset/Fieldset.vue | 46 ++++++++++++++++++++++++++++ src/components/panel/Panel.css | 2 +- src/components/panel/Panel.vue | 2 +- src/main.js | 2 ++ src/router.js | 5 +++ src/views/fieldset/FieldsetDemo.vue | 44 ++++++++++++++++++++++++++ 9 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 src/components/fieldset/Fieldset.css create mode 100644 src/components/fieldset/Fieldset.vue create mode 100644 src/views/fieldset/FieldsetDemo.vue diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 7c217bdc5..70939c6e8 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -43,6 +43,7 @@
● Panel + ● Fieldset
diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index eb880c4f3..3ef646eec 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -2,4 +2,5 @@ @import '../../components/inputtext/InputText.css'; @import '../../components/listbox/ListBox.css'; @import '../../components/button/Button.css'; -@import '../../components/panel/Panel.css'; \ No newline at end of file +@import '../../components/panel/Panel.css'; +@import '../../components/fieldset/Fieldset.css'; \ No newline at end of file diff --git a/src/components/fieldset/Fieldset.css b/src/components/fieldset/Fieldset.css new file mode 100644 index 000000000..ae43cec00 --- /dev/null +++ b/src/components/fieldset/Fieldset.css @@ -0,0 +1,45 @@ +.p-fieldset, +.p-fieldset .p-fieldset-legend { + padding: 0.5em 1em; +} + +.p-fieldset-toggleable .p-fieldset-legend { + padding: 0; +} + +.p-fieldset-toggleable .p-fieldset-legend a { + padding: 0.5em 1em; + cursor:pointer; + white-space: nowrap; + display: block; +} + +.p-fieldset .p-fieldset-toggler { + margin-right: .1em; + display: inline-block; + vertical-align: middle; +} + +.p-fieldset .p-fieldset-legend-text { + vertical-align: middle; +} + +.p-fieldset-content-wrapper-enter, +.p-fieldset-content-wrapper-leave-to { + max-height: 0; +} + +.p-fieldset-content-wrapper-enter-to, +.p-fieldset-content-wrapper-leave { + max-height: 1000px; +} + +.p-fieldset-content-wrapper-leave-active { + overflow: hidden; + transition: max-height 0.45s cubic-bezier(0, 1, 0, 1); +} + +.p-fieldset-content-wrapper-enter-active { + overflow: hidden; + transition: max-height 1s ease-in-out; +} \ No newline at end of file diff --git a/src/components/fieldset/Fieldset.vue b/src/components/fieldset/Fieldset.vue new file mode 100644 index 000000000..8d33d1002 --- /dev/null +++ b/src/components/fieldset/Fieldset.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/components/panel/Panel.css b/src/components/panel/Panel.css index 662537c05..db76e848d 100644 --- a/src/components/panel/Panel.css +++ b/src/components/panel/Panel.css @@ -48,7 +48,7 @@ .p-panel-content-wrapper-leave-active { overflow: hidden; - transition: max-height 0.5s cubic-bezier(0, 1, 0, 1); + transition: max-height 0.45s cubic-bezier(0, 1, 0, 1); } .p-panel-content-wrapper-enter-active { diff --git a/src/components/panel/Panel.vue b/src/components/panel/Panel.vue index 9c9d6623a..4f7e78b65 100644 --- a/src/components/panel/Panel.vue +++ b/src/components/panel/Panel.vue @@ -4,7 +4,7 @@ {{header}} - + diff --git a/src/main.js b/src/main.js index 0b04f4742..1f6190fd7 100644 --- a/src/main.js +++ b/src/main.js @@ -5,6 +5,7 @@ import InputText from './components/inputtext/InputText'; import ListBox from './components/listbox/ListBox'; import Button from './components/button/Button'; import Panel from './components/panel/Panel'; +import Fieldset from './components/fieldset/Fieldset'; import './assets/styles/primevue.css'; import 'primeflex/primeflex.css'; @@ -16,6 +17,7 @@ Vue.component('p-inputtext', InputText); Vue.component('p-button', Button); Vue.component('p-listBox', ListBox); Vue.component('p-panel', Panel); +Vue.component('p-fieldset', Fieldset); new Vue({ router, diff --git a/src/router.js b/src/router.js index eac022fc1..9ee4ea7b8 100644 --- a/src/router.js +++ b/src/router.js @@ -30,6 +30,11 @@ export default new Router({ path: '/panel', name: 'panel', component: () => import('./views/panel/PanelDemo.vue') + }, + { + path: '/fieldset', + name: 'fieldset', + component: () => import('./views/fieldset/FieldsetDemo.vue') } ] }); diff --git a/src/views/fieldset/FieldsetDemo.vue b/src/views/fieldset/FieldsetDemo.vue new file mode 100644 index 000000000..8922aaef8 --- /dev/null +++ b/src/views/fieldset/FieldsetDemo.vue @@ -0,0 +1,44 @@ + + + + +