EnTableToolbar
- An
EnTableBasiccomponent with a toolbar - Uses the same core props as
EnTableBasic - Toolbar contains copy to clipboard, download to csv, and simple text filtering
- Slots available to add buttons and replace the buttons or entire toolbar area
- Toaster message will display after copy if the Toaster is defined
Preview
Props
| Name | Description | Default | Control |
|---|---|---|---|
| headings | An array containing the labels for the columns of the table and optional key that matches to data in the row object. array | […] | complex object |
| rows | An array of table data containing objects or array of strings or numbers, where each object/array is a row of table data. Objects are recommended for full feature use. array | […] | complex object |
| groups | Optional grouped table data. When provided (non-empty), the table renders one
array | […] | complex object |
| showGroupHeadings | Whether each group opens with a heading row. Turn it off when the group is already identifiable from the rows themselves — a column repeating the group name, or a totals row that names it — and the heading would just be a redundant band. A group select-all still forces the row to render, since that is where its checkbox lives. boolean | true | |
| groupSelectAll | Adds a select-all checkbox to each group's heading row that toggles only that
group's rows within the shared selection. Requires boolean | false | |
| rowType | The type of each row of the table. string | "object" | |
| headerClass | CSS class that will be applied to all table headers. string | "" | |
| wrapHeader | Whether or not the text in the table headers should be wrapped. boolean | true | |
| enableBulkAction | Enables checkboxes for bulk actions. NOTE: must have a v-model binding to an array to work properly.
Do NOT also add a manual boolean | false | |
| bulkActionProperty | Sets a property to pull from each selected item instead of the full object. e.g. set to 'Id' if you want to only include the Id from the selected objects. string | null | |
| totals | Optional grand totals rendered in a object | null | complex object |
| fixedLayout | Switches the table to a fixed layout, which makes column widths absolute rather than negotiable. Widths are honoured either way in the ordinary case — this only changes the two situations where the automatic layout overrules them. Content that cannot wrap narrower than its column (a long unbroken code) stops widening that column and overflows instead, and widths that together exceed the table stop being scaled down to fit, so the table overflows its container. Columns with no width share whatever is left. Reach for it when a width has to hold exactly. It is not needed to make widths work. boolean | false | |
| qaId | Id that can be set for automation selectors. string | "" | |
| modelValue | Use v-model to bind to value of the bulk selected items. unknown[] | unknown | |
| fileName | Filename for csv download. string | null | |
| showButtons | Shows download and print buttons. boolean | true | |
| showFilter | Shows filter for searching table. boolean | true | |
| filterTerm | Shows filter for searching table. string | "" | |
| useJsonDownload | Sets download to use the raw JSON instead of data in the table. boolean | false | |
| filterOnKeys | Pass an array of strings equal to the key values of the table columns or json data that should be filtered when searching. unknown[] | unknown | |
| filterPlaceholder | Sets the placeholder value for the text filter. string | "Search table" | |
| tableClass | Adds additional CSS classes to the built-in table. string | "" | |
| showClipboardBtn | Shows the copy to clipboard button. boolean | true | |
| showCsvBtn | Shows the download CSV button. boolean | true | |
| hideToolbar | Hides the full toolbar. Can be used to control filtering by the filter term prop. boolean | false | |
| filterWidth | Sets a max-width on the filter input. string | number | "250" | |
| useSorting | Adds table sorting. boolean | false | |
| responsive | Uses table wrapper to make it scroll horizontally if needed. boolean | false |
Slots
toolbar
Replaces the full toolbar; must use slot variables to update filtering
Variables
| Name | Type | Description |
|---|---|---|
searchTerm | string | String used to filter the table rows |
updateFilter | function | Function that can be used to update the filtering by passing in a string |
bulk-action
Replaces the `Apply` button which is viewable when `enableBulkAction` is set to `true`
Variables
| Name | Type | Description |
|---|---|---|
selectedItems | array | An array of the selected items for bulk actions. |
toolbar-left
Places content on the left side of the toolbar
toolbar-buttons
Replaces all the buttons left of the filter.
additional-buttons
Places additional buttons to the right of the download buttons.
filter
Replaces the filter input; must use slot variables to update filtering
Variables
| Name | Type | Description |
|---|---|---|
searchTerm | string | String used to filter the table rows |
updateFilter | function | Function that can be used to update the filtering by passing in a string |
table
Replaces the full table; must use slot variables to keep flitering and download functionality
Variables
| Name | Type | Description |
|---|---|---|
rows | array | Filtered table rows. |
headings | array | Mapped headings from the passed in prop. |
${slot}
Dynamically generated slot based on the key or slot property in the heading object; used to modify the columns display value
Variables
| Name | Type | Description |
|---|---|---|
content | any | Default display value |
row | object | Full row object |
row-index | number | Row index, does not take any pagination into account |
heading-index | number | Column index |
Events
update:model-value
Binds the selected rows to v-model
filter
Fires when they filtering changes
Payload
| Name | Type | Description |
|---|---|---|
filteredRows | array | The filtered rows |
apply-action
Fires on click of the apply button for bulk actions
Payload
| Name | Type | Description |
|---|---|---|
selectedItems | array | The list of items that are selected. |
Methods
No methods defined.