diff --git a/package.json b/package.json index 33c74e3..a4e3001 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-object-list", - "version": "0.2.9", + "version": "0.2.10", "description": "React component to display an array of object data in a filterable view", "repository": { "url": "https://github.com/uptick/react-object-list", diff --git a/src/actions-filters/ActionsFiltersContainer.js b/src/actions-filters/ActionsFiltersContainer.js index 68d172a..4218884 100644 --- a/src/actions-filters/ActionsFiltersContainer.js +++ b/src/actions-filters/ActionsFiltersContainer.js @@ -71,6 +71,8 @@ class ActionsFilterContainer extends Component { icons: PropTypes.object, /** Object of custom react-select styles */ selectStyles: PropTypes.object, + /** Show item count if we are using data **/ + showItemCount: PropTypes.bool, } static defaultProps = { @@ -81,6 +83,7 @@ class ActionsFilterContainer extends Component { columns: [], status: STATUS_CHOICES.done, selectStyles: {}, + showItemCount: true, } state = { @@ -110,7 +113,7 @@ class ActionsFilterContainer extends Component { filters, updateFilter, removeFilter, status, updateColumns, loadFavourite, handleAddFavourite, selectedFavouriteName, handleDeleteFavourite, favourites, - selectStyles, + selectStyles, showItemCount, } = this.props const loading = status === STATUS_CHOICES.loading let search @@ -141,7 +144,7 @@ class ActionsFilterContainer extends Component { (!search || f.filterKey !== searchKey) && // remove search filter - ((f.permanent !== undefined && !f.permanent) || (f.permanent === undefined && !f.Renderer.defaultProps.permanent)) // remove filters to display permanently + ((f.permanent !== undefined && !f.permanent) || (f.permanent === undefined && (!f.Renderer || !f.Renderer.defaultProps.permanent))) // remove filters to display permanently )} addFilter={this.props.addFilter} selectStyles={selectStyles} @@ -170,11 +173,13 @@ class ActionsFilterContainer extends Component { {/* TODO: render children below filters */}
- - {loading ? `Loading ${itemPluralName}...` : ( - `${totalCount ? totalCount.toLocaleString() : 'No'} ${totalCount === 1 ? itemSingleName : itemPluralName} found` - )} - + {showItemCount && ( + + {loading ? `Loading ${itemPluralName}...` : ( + `${totalCount ? totalCount.toLocaleString() : 'No'} ${totalCount === 1 ? itemSingleName : itemPluralName} found` + )} + + )} {customActions[0] && customActions[0]({ selection, itemCount, diff --git a/src/index.js b/src/index.js index eb32840..3f3d7ba 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,8 @@ import ObjectList from './ObjectList' -export {COLUMN_TYPE} from './ObjectList' +import ActionsFilterContainer from './actions-filters/ActionsFiltersContainer' +export { COLUMN_TYPE } from './ObjectList' +export { FILTER_BASE_TYPE, META_TYPE, STATUS_TYPE, STATUS_CHOICES, SELECTION_TYPE } from './utils/proptypes' export default ObjectList + +const FilterContainer = ActionsFilterContainer +export { FilterContainer }