Skip to content

Commit

Permalink
feat: add select from items per page in table and smart table paginat…
Browse files Browse the repository at this point in the history
…ion (#360)

* feat: select from items per page in table and smart-table pagination #352

* feat: add select from items per page in table and smart table pagination

* feat: adjust dropdown position when his at bottom's page

* fix: dropdown showing up above footer table

Co-authored-by: Pedro Miguel <[email protected]>
Co-authored-by: Iury Nogueira <[email protected]>
  • Loading branch information
3 people authored Jan 5, 2023
1 parent 3cbb324 commit ae8973b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions projects/ion/src/lib/dropdown/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export class DropdownComponent implements AfterViewInit {
const elementProps = element.getBoundingClientRect();
const elementRight = elementProps.right;
elementRight > widthContainer && (element.style.right = '0');

const heightContainer = window.innerHeight;
const elementBottom = elementProps.bottom;
elementBottom > heightContainer && (element.style.bottom = '42px');
}

mouseEnter(option: DropdownItem): void {
Expand Down
1 change: 1 addition & 0 deletions projects/ion/src/lib/pagination/pagination.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[options]="optionsPage"
customId="btn-select"
(selected)="changeItemsPerPage($event)"
type="secondary"
></ion-button>

<ion-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
<ion-icon size="40" type="exclamation-rounded"></ion-icon>
<span>Não há dados</span>
</div>

<div
*ngIf="config.pagination && config.data && config.data.length"
data-testid="pagination-container"
Expand All @@ -137,6 +136,7 @@
[page]="config.pagination.page"
size="md"
(events)="paginationEvents($event)"
[allowChangeQtdItems]="true"
></ion-pagination>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions projects/ion/src/lib/table/table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ $radius: 8px;
.ion-table {
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.15);
border-radius: $radius;
max-height: 660px;
overflow-y: auto;
}

table {
border-collapse: collapse;
position: relative;
width: 100%;
max-height: 592px;
overflow-y: auto;

& .border-header {
border-bottom: 1px solid $neutral-4;
Expand Down Expand Up @@ -135,7 +135,6 @@ table {
display: flex;
justify-content: space-between;
padding: 16px;
overflow-x: auto;
gap: spacing(2);

position: sticky;
Expand All @@ -152,6 +151,7 @@ table {
font-size: 14px;
line-height: 20px;
color: $neutral-7;

}

.noData {
Expand Down

0 comments on commit ae8973b

Please sign in to comment.