Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,51 @@
<th>Description</th>
</tr>
<tr>
<td>margin: any (string | object)</td>
<td></td>
<td>collectionResource: object[]</td>
<td><code>[]</code></td>
<td>
Size of the margin to be applied to the component ('xxsmall' | 'xsmall' |
'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). You can pass an
object with 'top', 'bottom', 'left' and 'right' properties in order to
specify different padding sizes.
An array of objects with the values to display in the table. The key is
the column and the value is the property to be displayed in the cell.
</td>
</tr>
<tr>
<td>showGoToPage: boolean</td>
<td><code>true</code></td>
<td>Show page navigation select.</td>
</tr>
<tr>
<td>itemsPerPage: number</td>
<td><code>5</code></td>
<td>Number of items per page.</td>
</tr>
<tr>
<td>showGoToPage: boolean</td>
<td><code>false</code></td>
<td>Show page navigation select.</td>
</tr>
<tr>
<td>itemsPerPageOptions: number[]</td>
<td>
<code>[]</code>
</td>
<td>
An array of objects representing the selectable options of the items per
page input.
</td>
<td>An array of numbers representing the items per page options.</td>
</tr>
<tr>
<td>collectionResource: object[]</td>
<td><code>[]</code></td>
<td>
An array of objects with the values to display in the table. The key is
the column and the value is the property to be displayed in the cell.
</td>
<td>tabIndexValue: number</td>
<td><code>0</code></td>
<td>Value of the tabindex attribute given to the sortable icon.</td>
</tr>
<tr>
<td>onGoToPage: EventEmitter</td>
<td>itemsPerPageFunction: EventEmitter</td>
<td></td>
<td>
This event will emit the new page when the user interacts with the page
navigation buttons or select.
This event will emit in case of the user selects an item per page option.
The value selected will be passed as a parameter.
</td>
</tr>
<tr>
<td>itemsPerPageFunction: EventEmitter</td>
<td>margin: string | object</td>
<td></td>
<td>
This function will be called when the user picks an option for the
itemsPerPage select. The value selected will be passed as a parameter.
Size of the margin to be applied to the component ('xxsmall' | 'xsmall' |
'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). You can pass an
object with 'top', 'bottom', 'left' and 'right' properties in order to
specify different padding sizes.
</td>
</tr>
</dxc-table>
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ <h3 class="subtitle-api">Directives</h3>
<td>
<code>
<ul class="ul-code">
<li>isSortable:false</li>
<li>propertyName:''</li>
<li>isSortable: false</li>
<li>propertyName: ''</li>
</ul>
</code>
</td>
<td>
An array of objects representing if the column is going to be sorted and
the key value.
<ul>
<li><b>isSortable</b>: boolean value if it is sorteable.</li>
<li>
<b>propertyName</b>: string with the key from the array of objects.
<b>isSortable</b>: Boolean value to indicate whether the column is
sortable or not.
</li>
<li>
<b>propertyName</b>: String with the key from the array of objects.
</li>
</ul>
</td>
Expand All @@ -36,11 +39,6 @@ <h3 class="subtitle-api">Directives</h3>
<td></td>
<td>Column definition.</td>
</tr>
<tr>
<td>tabIndexValue: number</td>
<td><code>0</code></td>
<td>Value of the tabindex for the sortable icon.</td>
</tr>
<tr>
<td>dxcCellDef: Iterable&lt;string&gt;</td>
<td></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,103 +20,106 @@
</tbuilder-component-mode>
<tbuilder-component-mode text="Resultset Table">
<dxc-resultset-table
itemsPerPage="2"
[collectionResource]="data">
<ng-container dxcColumnDef="id">
<td *dxcCellDef="let item">
{{item['id']}}
</td>
</ng-container>
<ng-container
dxcColumnDef="name"
[sortable]="{isSortable:true, propertyName:'name'}"
itemsPerPage="2"
(itemsPerPageFunction)="itemsPerPageFunction($event)"
[itemsPerPageOptions]="[2, 3]"
[showGoToPage]="true"
[collectionResource]="data"
>
<td *dxcCellDef="let item">
{{item['name']}}
</td>
</ng-container>
<ng-container dxcColumnDef="city">
<td *dxcCellDef="let item">
{{item['city']}}
</td>
</ng-container>
<ng-container
dxcColumnDef="actions"º
[sortable]="{isSortable:true, propertyName:'actions'}"
>
<td *dxcCellDef="let item">
<dxc-button
*ngIf="item['actions'] === true"
label="Delete"
></dxc-button>
</td>
</ng-container>
</dxc-resultset-table>
<ng-container dxcColumnDef="id">
<td *dxcCellDef="let item">
{{ item["id"] }}
</td>
</ng-container>
<ng-container
dxcColumnDef="name"
[sortable]="{ isSortable: true, propertyName: 'name' }"
>
<td *dxcCellDef="let item">
{{ item["name"] }}
</td>
</ng-container>
<ng-container dxcColumnDef="city">
<td *dxcCellDef="let item">
{{ item["city"] }}
</td>
</ng-container>
<ng-container
dxcColumnDef="actions"
[sortable]="{ isSortable: true, propertyName: 'actions' }"
>
<td *dxcCellDef="let item">
<dxc-button
*ngIf="item['actions'] === true"
label="Delete"
></dxc-button>
</td>
</ng-container>
</dxc-resultset-table>
</tbuilder-component-mode>
<tbuilder-component-mode text="With scroll">
<div class="tablePreviewContainer">
<dxc-table [margin]="tableDefaultMargin">
<tr>
<th>header<br/>subheader</th>
<th>header<br/>subheader</th>
<th>header<br/>subheader</th>
</tr>
<tr>
<th>header<br />subheader</th>
<th>header<br />subheader</th>
<th>header<br />subheader</th>
</tr>
<tr>
<td>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
</td>
<td>
Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat.
</td>
<td>
Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.
</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
<tr>
</tr>
<tr>
<td>cell data</td>
<td>cell data</td>
<td>cell data</td>
</tr>
</tr>
</dxc-table>
</div>
</tbuilder-component-mode>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,8 @@ export class TablePreviewComponent implements OnInit, Stylable {
ngOnInit(): void {
this.className = this.getDynamicStyle();
}

itemsPerPageFunction(event) {
console.log("event:", event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import { SortService } from "../../services/sort.service";
id="header-{{ columnName }}-{{ parentClassName }}"
propertyname="{{ propertyName }}"
[ngClass]="[isSortable ? 'isSortable' : '']"
[tabIndex]="isSortable ? tabIndexValue : -1"
>
{{ columnName }}
<span
id="iconSort-{{ columnName }}-{{ parentClassName }}"
*ngIf="isSortable"
[tabIndex]="tabIndexValue"
></span>
</div>`,
styleUrls: ["./dxc-header-row-component.scss"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "@angular/core";
import { DxcCellDef } from "./dxc-cell-def.directive";
import { DXC_RESULTSET_TABLE } from "./../tokens";
import { coerceNumberProperty } from '@angular/cdk/coercion';

/** Base interface for a cell definition. Captures a column's cell template definition. */

Expand Down Expand Up @@ -40,15 +39,6 @@ export class DxcColumnDef extends _DxcColumnDefBase {

@Input("sortable") sortable = { isSortable: false, propertyName: "" };

@Input()
get tabIndexValue(): number {
return this._tabIndexValue;
}
set tabIndexValue(value: number) {
this._tabIndexValue = coerceNumberProperty(value);
}
private _tabIndexValue;

/** @docs-private */
@ContentChild(DxcCellDef, { static: true }) cell: DxcCellDef;

Expand Down
Loading