generated from druxt/module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#89): add group filter component
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template> | ||
<div | ||
:class="`ct-group-filter ${themeClass}`" | ||
data-component-name="ct-group-filter" | ||
> | ||
<div class="container" data-ct-group-filter-element=""> | ||
<div class="row"> | ||
<div class="col-xxs-12"> | ||
<div class="row row--no-wrap"> | ||
<div class="col col--no-grow"> | ||
<div class="ct-align-middle"> | ||
<CTLabel class="ct-group-filter__title" :theme="theme"> | ||
{{ title }} | ||
</CTLabel> | ||
</div> | ||
</div> | ||
|
||
<div class="col"> | ||
<div class="ct-align-middle"> | ||
<CTItemList | ||
class="ct-group-filter__filters" | ||
data-ct-group-filter-filters="" | ||
:items="filters" | ||
size="large" | ||
:theme="theme" | ||
type="horizontal" | ||
> | ||
<template #default="{ item }"> | ||
<CTPopover :trigger="item.name"> | ||
<slot :name="`filter-${item.id}`"> | ||
<!-- @TODO - default filter? --> | ||
</slot> | ||
</CTPopover> | ||
</template> | ||
</CTItemList> | ||
</div> | ||
</div> | ||
|
||
<div class="col col--no-grow"> | ||
<div class="ct-align-middle"> | ||
<CTButton | ||
@click.native="$emit('apply')" | ||
class="ct-group-filter__submit" | ||
icon="approve" | ||
icon-position="before" | ||
icon-size="small" | ||
size="small" | ||
text="Apply" | ||
type="secondary" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import ThemeMixin from '../mixins/theme' | ||
export default { | ||
mixins: [ThemeMixin], | ||
props: { | ||
filters: { | ||
type: Array, | ||
required: true | ||
}, | ||
title: { | ||
type: String, | ||
default: 'Filter results by:' | ||
} | ||
} | ||
} | ||
</script> |