Skip to content

Commit

Permalink
PATCH: add possibility to custom paginatedList : (#191)
Browse files Browse the repository at this point in the history
* add possibility to custom paginatedList :

- background-color property
- display or not number of data elements
- display or not first and last chevron icons

* add default value for backgroundColor props
  • Loading branch information
LrxGaelle committed Apr 13, 2022
1 parent a91e34b commit 2e64152
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<ul class="bimdata-list bimdata-navigation">
<ul
class="bimdata-list bimdata-navigation"
:style="{ 'background-color': backgroundColor }"
>
<li class="bimdata-navigation__left m-r-6">
<slot name="left"></slot>
</li>
Expand Down Expand Up @@ -107,6 +110,10 @@ export default {
type: Boolean,
default: false,
},
backgroundColor: {
type: String,
default: "var(--color-white)",
},
},
emits: ["first", "previous", "next", "last"],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
height: 38px;
justify-content: center;
align-items: center;
background-color: var(--color-white);
&__item {
padding: 6px 2px;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
@pagechanged="onPageChange"
:totalPages="totalPages"
:perPage="perPage"
:first="first"
:last="last"
:numberDataElements="numberDataElements"
:backgroundColor="backgroundColor"
/>
</div>
</div>
Expand Down Expand Up @@ -57,6 +61,22 @@ export default {
type: Boolean,
default: false,
},
first: {
type: Boolean,
default: true,
},
last: {
type: Boolean,
default: true,
},
numberDataElements: {
type: Boolean,
default: true,
},
backgroundColor: {
type: String,
default: "var(--color-white)",
},
},
emits: ["element-click"],
data() {
Expand Down
11 changes: 10 additions & 1 deletion src/BIMDataComponents/BIMDataPagination/BIMDataPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
:nextDisabled="isLastPage"
:lastDisabled="isLastPage"
class="bimdata-pagination"
:backgroundColor="backgroundColor"
>
<template #left>
<template #left v-if="numberDataElements">
{{ firstIndex }} - {{ lastIndex }} of {{ length }}
</template>
<span class="bimdata-pagination__item">
Expand Down Expand Up @@ -43,6 +44,14 @@ export default {
type: Number,
required: true,
},
numberDataElements: {
type: Boolean,
default: true,
},
backgroundColor: {
type: String,
default: "var(--color-white)",
},
perPage: {
type: Number,
required: true,
Expand Down

0 comments on commit 2e64152

Please sign in to comment.