From 50d239af658ad8a50fc85aa4344d0309bed91ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Merve=20=C3=96z=C3=A7if=C3=A7i?= Date: Fri, 15 Mar 2019 15:51:48 +0300 Subject: [PATCH] Paginator added --- src/AppMenu.vue | 1 + src/assets/styles/primevue.css | 1 + .../paginator/CurrentPageReport.vue | 33 ++++ src/components/paginator/FirstPageLink.vue | 23 +++ src/components/paginator/LastPageLink.vue | 23 +++ src/components/paginator/NextPageLink.vue | 23 +++ src/components/paginator/PageLinks.vue | 26 +++ src/components/paginator/Paginator.css | 99 +++++++++++ src/components/paginator/Paginator.vue | 158 ++++++++++++++++++ src/components/paginator/PrevPageLink.vue | 23 +++ .../paginator/RowsPerPageDropdown.vue | 26 +++ src/main.js | 2 + src/router.js | 5 + src/views/paginator/PaginatorDemo.vue | 44 +++++ 14 files changed, 487 insertions(+) create mode 100644 src/components/paginator/CurrentPageReport.vue create mode 100644 src/components/paginator/FirstPageLink.vue create mode 100644 src/components/paginator/LastPageLink.vue create mode 100644 src/components/paginator/NextPageLink.vue create mode 100644 src/components/paginator/PageLinks.vue create mode 100644 src/components/paginator/Paginator.css create mode 100644 src/components/paginator/Paginator.vue create mode 100644 src/components/paginator/PrevPageLink.vue create mode 100644 src/components/paginator/RowsPerPageDropdown.vue create mode 100644 src/views/paginator/PaginatorDemo.vue diff --git a/src/AppMenu.vue b/src/AppMenu.vue index 823f6ac60..6d1692a7f 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -50,6 +50,7 @@
● FullCalendar + ● Paginator
diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index 38a7b57eb..96772d54e 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -16,6 +16,7 @@ @import '../../components/message/Message.css'; @import '../../components/multiselect/MultiSelect.css'; @import '../../components/overlaypanel/OverlayPanel.css'; +@import '../../components/paginator/Paginator.css'; @import '../../components/panel/Panel.css'; @import '../../components/password/Password.css'; @import '../../components/progressbar/ProgressBar.css'; diff --git a/src/components/paginator/CurrentPageReport.vue b/src/components/paginator/CurrentPageReport.vue new file mode 100644 index 000000000..4be4ded7c --- /dev/null +++ b/src/components/paginator/CurrentPageReport.vue @@ -0,0 +1,33 @@ + + \ No newline at end of file diff --git a/src/components/paginator/FirstPageLink.vue b/src/components/paginator/FirstPageLink.vue new file mode 100644 index 000000000..fa69fd569 --- /dev/null +++ b/src/components/paginator/FirstPageLink.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/src/components/paginator/LastPageLink.vue b/src/components/paginator/LastPageLink.vue new file mode 100644 index 000000000..7edb3c8dc --- /dev/null +++ b/src/components/paginator/LastPageLink.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/src/components/paginator/NextPageLink.vue b/src/components/paginator/NextPageLink.vue new file mode 100644 index 000000000..5b3f5ee5e --- /dev/null +++ b/src/components/paginator/NextPageLink.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/src/components/paginator/PageLinks.vue b/src/components/paginator/PageLinks.vue new file mode 100644 index 000000000..8fc4ca3be --- /dev/null +++ b/src/components/paginator/PageLinks.vue @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/src/components/paginator/Paginator.css b/src/components/paginator/Paginator.css new file mode 100644 index 000000000..5b4ed5ae3 --- /dev/null +++ b/src/components/paginator/Paginator.css @@ -0,0 +1,99 @@ +.p-paginator { + margin: 0; + text-align: center; + padding: .125em; +} + +.p-paginator .p-paginator-top { + border-bottom: 0 none; +} + +.p-paginator .p-paginator-bottom { + border-top:0 none; +} + +.p-paginator .p-paginator-left-content { + float: left; +} + +.p-paginator .p-paginator-right-content { + float: right; +} + +.p-paginator .p-paginator-page, +.p-paginator .p-paginator-pages, +.p-paginator .p-paginator-next, +.p-paginator .p-paginator-last, +.p-paginator .p-paginator-first, +.p-paginator .p-paginator-prev, +.p-paginator .p-paginator-current { + display: inline-block; + width: 1.5em; + height: 1.5em; + line-height: 1.5em; + zoom: 1; + margin-left: .063em; + margin-right: .063em; + text-decoration: none; + vertical-align: middle; + text-align: center; + position: relative; +} + +.p-paginator .p-paginator-pages { + width: auto; + line-height: 1; +} + +.p-paginator .p-paginator-icon { + display: block; + position: absolute; + left: 50%; + top: 50%; + width: 1em; + height: 1em; + margin-top: -.5em; + margin-left: -.5em; +} + +.p-paginator .p-paginator-page, +.p-paginator .p-paginator-next, +.p-paginator .p-paginator-last, +.p-paginator .p-paginator-first, +.p-paginator .p-paginator-prev{ + cursor: pointer; +} + +.p-paginator .p-paginator-current, +.p-paginator .p-paginator-rpp-options { + margin-left: 1em; + margin-right: 1em; + background-image: none; +} + +.p-paginator .p-paginator-jtp-select option, +.p-paginator .p-paginator-rpp-options option { + background-image: none; + border: 0 none; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} + +.p-paginator a.p-disabled { + outline: 0 none; +} + +.p-paginator .p-dropdown { + min-width: 4em; + margin-left: .375em; +} + +.p-fluid .p-paginator .p-dropdown { + width: auto; +} + +.p-paginator .p-paginator-current { + width: auto; + height: auto; +} \ No newline at end of file diff --git a/src/components/paginator/Paginator.vue b/src/components/paginator/Paginator.vue new file mode 100644 index 000000000..0f6267326 --- /dev/null +++ b/src/components/paginator/Paginator.vue @@ -0,0 +1,158 @@ + + + \ No newline at end of file diff --git a/src/components/paginator/PrevPageLink.vue b/src/components/paginator/PrevPageLink.vue new file mode 100644 index 000000000..d0965fa54 --- /dev/null +++ b/src/components/paginator/PrevPageLink.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/src/components/paginator/RowsPerPageDropdown.vue b/src/components/paginator/RowsPerPageDropdown.vue new file mode 100644 index 000000000..143d51788 --- /dev/null +++ b/src/components/paginator/RowsPerPageDropdown.vue @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index ce9dcdaac..587a39878 100644 --- a/src/main.js +++ b/src/main.js @@ -21,6 +21,7 @@ import Listbox from './components/listbox/Listbox'; import Message from './components/message/Message'; import MultiSelect from './components/multiselect/MultiSelect'; import OverlayPanel from './components/overlaypanel/OverlayPanel'; +import Paginator from './components/paginator/Paginator'; import Panel from './components/panel/Panel'; import Password from './components/password/Password'; import ProgressBar from './components/progressbar/ProgressBar'; @@ -69,6 +70,7 @@ Vue.component('Listbox', Listbox); Vue.component('Message', Message); Vue.component('MultiSelect', MultiSelect); Vue.component('OverlayPanel', OverlayPanel); +Vue.component('Paginator', Paginator); Vue.component('Panel', Panel); Vue.component('Password', Password); Vue.component('ProgressBar', ProgressBar); diff --git a/src/router.js b/src/router.js index 7bc14c5bb..47627bd08 100644 --- a/src/router.js +++ b/src/router.js @@ -151,6 +151,11 @@ export default new Router({ name: 'overlaypanel', component: () => import('./views/overlaypanel/OverlayPanelDemo.vue') }, + { + path: '/paginator', + name: 'paginator', + component: () => import('./views/paginator/PaginatorDemo.vue') + }, { path: '/panel', name: 'panel', diff --git a/src/views/paginator/PaginatorDemo.vue b/src/views/paginator/PaginatorDemo.vue new file mode 100644 index 000000000..4924528fa --- /dev/null +++ b/src/views/paginator/PaginatorDemo.vue @@ -0,0 +1,44 @@ + + + + +