Skip to content

Commit

Permalink
Merge branch 'main' of github.com:unepwcmc/wcmc-components into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxycle committed Jul 7, 2022
2 parents 7bfbfed + 05f69a4 commit 0bb52fc
Show file tree
Hide file tree
Showing 13 changed files with 491 additions and 400 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
### 2.2.2

- Fix: Remove page buttons (numbers) from pagination

### 2.2.1

- Feature:
- Allow the modal to display a list in a bulletpoint style or inline style, implemented via a key in the existing `options` prop: `modal.bulletDisplay`, which can be set to true to have bulletpoint style or false to have inline style (with words separated by a semi-colon)
- Make URLs hyperlinks, styled in blue
- Give the option to pin one filter option to the top of any filter, implemented via a key in the existing `options` prop: `filters.optionToPinAtTheTop`, which can be set to an array of objects containing the name of the filter and the option itself, like this => `[{filterName: nameOfFilter, option: nameOfOption},...,{filterName: nameOfFilter, option: nameOfOption}]`

### 2.2.0

- Feature:
- Allow the "more content" column (the rightmost column where users can either open a modal or be redirected to a URL) to be disabled
- Implemented via a key in the existing `options` prop: `hideMoreContentColumn`, which can be set to true to remove the column entirely
- Provide example usage comment in Serve.vue

### 2.1.2

- Chore: run build and build-lib, update version in package.json

### 2.1.1

- Chore: run build and build-lib, update version in package.json
Expand Down
7 changes: 7 additions & 0 deletions dev/Serve.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
<filterable-table
endpoint-download="/"
>
<!--
Example of an options prop that would disable the "show more content" column for the whole table
:options="{
hideMoreContentColumn: true
}"
-->

<!--
<template #sort-icon>
<span>This element is used as the sorting icon now!</span>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unep-wcmc/wcmc-components",
"version": "2.1.1",
"version": "2.2.2",
"repository": {
"type": "git",
"url": "git+https://github.com/unepwcmc/wcmc-components.git"
Expand Down
10 changes: 7 additions & 3 deletions src/components/filterable-table/FilterableTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export default {
isSortable: 'isSortable',
requestedPage: 'getRequestedPage',
selectedFilterOptions: 'getSelectedFilterOptions',
selectedSort: 'getSelectedSort'
selectedSort: 'getSelectedSort',
isMoreContentColumnDisplayed: 'isMoreContentColumnDisplayed'
}),
cssVariables () {
Expand Down Expand Up @@ -238,9 +239,12 @@ export default {
},
getTotalTableColumns () {
// Add an additional column for the "View more" button
if (this.headings.length > 0) {
if (this.headings.length < 1) { return }
if (this.isMoreContentColumnDisplayed(this.id)) {
this.totalColumns = this.headings.length + 1
} else {
this.totalColumns = this.headings.length
}
},
Expand Down
Loading

0 comments on commit 0bb52fc

Please sign in to comment.