Valtimo Carbon List
Valtimo Carbon List
The valtimo-carbon-list
is a component to make building lists faster and easier.
There are a few options for defining lists, besides the Simple List defined below:
Setting up a simple list
To use the CarbonListComponent there is a series of steps.
Import the CarbonListModule into your module:
sample.module.ts
Add the
valtimo-carbon-list
tag in your template (this example displays a simple list):sample.component.html
Define your attributes in the component code:
sample.component.ts
This will create a simple list that shows the two items.
Clicking on rows
The (rowClicked)
property is used to add an action when the user clicks on a row
The property must be added with a reference to a method
sample.component.html
The method must be defined in the component
sample.component.ts
No results view
However, the no results view can be customized like this:
sample.component.html
Overview of the @Input
and @Output
fields of the CarbonListComponent
@Input
and @Output
fields of the CarbonListComponent
Inputs
Property | Type | Required | Default | Description |
---|---|---|---|---|
|
| yes | [] | The data displayed in the list. |
|
| yes | [] | The object that defines the header and displayed fields of the items. The ColumnConfig interface is defined in the '@valtimo/components' library |
|
| no | [] | The object that defines Context Menu items. The ActionItem interface is deifned in the '@valtimo/components' library |
|
| no | false | Flag that defines wether or not the list displays a loading state. |
|
| no | false | Flag that defines wether or not the list displays a header. |
|
| no | false | Flag that hides or shows the column headers. |
|
| no | false | Flag that defines wether or not the list is searchable. Without any (search) event listener, the search is done in the FE by default. |
|
| no | undefined | Object that defines if there is an initial sorting applied to the list. The SortState is an interface defined in the '@valtimo/config' library. |
|
| no | false | Flag that defines wether or not arrows to move rows are displayed. |
|
| no | undefined | The object that defines BE supported pagination. The Pagination interface is defined in the |
|
| no | DEFAULT_PAGINATOR_CONFIG | The object that defines the options for pagination size and if a page input is displayed. The CarbonPaginatorConfig interface is defined in the |
|
| no | undefined | An identifier for storing pagination size in localStorage. |
|
| no | DEFAULT_LIST_TRANSLATIONS | The object that defines translations for the multi-select bar and the pagination. The CarbonListTranslations interface is defined in the |
|
| no | false | Flag that defines wether or not the list has multi-select enabled. |
|
| no | false | Flag that defines wether or not the rows in the list are striped. |
Outputs
Property | Type | Description |
---|---|---|
|
| Emits the item corresponded to the clicked row. |
|
| Emits the current page selected. |
|
| Emits the page size of the list. |
|
| Emits the search string. If this event listener is added, then the search should be provided by the BE. |
|
| Emits the new SortState. The SortState interface is defined in |
|
| Emits the MoveRowEvent. The MoveRowEvent interface is defined in |
Last updated