-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add paginator addon into table widget (#701)
* Add paginator addon into table widget * Refactor * Add unit tests * Adjust ITableWidgetConfig + add some tests * Paginator configuration prototype * Add pageSize and pageSizeSet into configuration * Add unit tests + minor changes * Final fixes + small refactor * Add documentation * Fix failing build * Minor fix * Fix bad import * PR review requests + better error handling * Lint error + bad datasource * Update imports
- Loading branch information
Showing
37 changed files
with
1,742 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...s/docs/widget-types/table/table-widget-paginator/docs/table-paginator-docs.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<h1>Table Widget with paginator</h1> | ||
|
||
<p> | ||
Table Widget can have pagination functionality. This page contains | ||
information only about setting up the pagination, so before proceeding get | ||
familiar with the following: | ||
</p> | ||
<ul> | ||
<li> | ||
<a | ||
href="../additional-documentation/anatomy/data-sources.html" | ||
target="_blank" | ||
><code>Data Sources</code></a | ||
> | ||
- for information about Data Sources and their Features. | ||
</li> | ||
<li> | ||
<a | ||
href="../additional-documentation/widget-types/table.html" | ||
target="_blank" | ||
><code>Table Widget</code></a | ||
> | ||
- for configuring a table widget itself. | ||
</li> | ||
</ul> | ||
|
||
<nui-example-wrapper | ||
filenamePrefix="table-widget-paginator-example" | ||
exampleTitle="Table widget with Paginator" | ||
> | ||
<table-widget-paginator-example></table-widget-paginator-example> | ||
</nui-example-wrapper> | ||
|
||
<h2>Configuring the Widget</h2> | ||
<p> | ||
To configure the widget you have to enable paginator in the widget | ||
configuration: | ||
</p> | ||
<nui-example-code language="typescript"> | ||
{{ tableConfigurationText }} | ||
</nui-example-code> |
47 changes: 47 additions & 0 deletions
47
...nts/docs/widget-types/table/table-widget-paginator/docs/table-paginator-docs.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// © 2022 SolarWinds Worldwide, LLC. All rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
import { Component } from "@angular/core"; | ||
|
||
@Component({ | ||
selector: "nui-table-paginator-docs", | ||
templateUrl: "./table-paginator-docs.component.html", | ||
}) | ||
export class TablePaginatorDocsComponent { | ||
public tableConfigurationText = ` | ||
"table": { | ||
... | ||
properties: { | ||
configuration: { | ||
// define paginator configuration here | ||
scrollType: ScrollType.paginator, | ||
paginatorConfiguration: { | ||
pageSize: 10, // Value have to be one of pageSizeSet values | ||
pageSizeSet: [10, 20, 30], | ||
}, | ||
// If not specified, default is set to | ||
// pageSize: 10, | ||
// pageSizeSet: [10, 20, 50], | ||
hasVirtualScroll: false, // Has to be speciefied because of backward compatibility | ||
} as ITableWidgetConfig, | ||
}, | ||
}, | ||
`; | ||
} |
29 changes: 29 additions & 0 deletions
29
...-types/table/table-widget-paginator/example/table-widget-paginator-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="mb-2 d-flex align-items-center"> | ||
<nui-switch class="ml-3 py-2" [(value)]="editMode" i18n> | ||
Edit Mode | ||
</nui-switch> | ||
<button | ||
*ngIf="!dashboard?.widgets['tableWidgetId']" | ||
type="button" | ||
displayStyle="action" | ||
(click)="reInitializeDashboard()" | ||
nui-button | ||
> | ||
Restore Widget | ||
</button> | ||
</div> | ||
|
||
<div class="w-100 dashboard"> | ||
<!-- | ||
Note: The dashboard and gridsterConfig input assignments must use banana-in-a-box notation to keep | ||
the dashboard state updated with changes to the pizzagna. | ||
--> | ||
<nui-dashboard | ||
*ngIf="dashboard" | ||
[(dashboard)]="dashboard" | ||
[editMode]="editMode" | ||
[(gridsterConfig)]="gridsterConfig" | ||
nuiWidgetEditor | ||
> | ||
</nui-dashboard> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
...-types/table/table-widget-paginator/example/table-widget-paginator-example.component.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dashboard { | ||
height: 400px; | ||
} |
Oops, something went wrong.