-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2566429
commit d3d66c1
Showing
9 changed files
with
262 additions
and
1 deletion.
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 @@ | ||
export * from './components/tag/Tag'; |
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,2 @@ | ||
'use strict'; | ||
module.exports = require('./components/tag/Tag.vue'); |
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
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,10 @@ | ||
import Vue from 'vue'; | ||
|
||
declare class Tag extends Vue { | ||
value?: any; | ||
severity?: string; | ||
rounded?: boolean; | ||
icon?: string; | ||
} | ||
|
||
export default Tag; |
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,49 @@ | ||
<template> | ||
<span :class="containerClass"> | ||
<slot> | ||
<span :class="iconClass" v-if="icon"></span> | ||
<span class="p-tag-value">{{value}}</span> | ||
</slot> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
value: null, | ||
severity: null, | ||
rounded: Boolean, | ||
icon: String | ||
}, | ||
computed: { | ||
containerClass() { | ||
return ['p-tag p-component', { | ||
'p-tag-info': this.severity === 'info', | ||
'p-tag-success': this.severity === 'success', | ||
'p-tag-warning': this.severity === 'warning', | ||
'p-tag-danger': this.severity === 'danger', | ||
'p-tag-rounded': this.rounded | ||
}]; | ||
}, | ||
iconClass() { | ||
return ['p-tag-icon', this.icon]; | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.p-tag { | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.p-tag-icon, | ||
.p-tag-value, | ||
.p-tag-icon.pi { | ||
line-height: 1.5; | ||
} | ||
.p-tag.p-tag-rounded { | ||
border-radius: 10rem; | ||
} | ||
</style> |
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
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
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,46 @@ | ||
<template> | ||
<div> | ||
<div class="content-section introduction"> | ||
<div class="feature-intro"> | ||
<h1>Tag</h1> | ||
<p>Tag component is used to categorize content.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="content-section implementation"> | ||
<div class="card"> | ||
<h5>Tags</h5> | ||
<Tag class="p-mr-2" value="Primary"></Tag> | ||
<Tag class="p-mr-2" severity="success" value="Success"></Tag> | ||
<Tag class="p-mr-2" severity="info" value="Info"></Tag> | ||
<Tag class="p-mr-2" severity="warning" value="Warning"></Tag> | ||
<Tag severity="danger" value="Danger"></Tag> | ||
|
||
<h5>Pills</h5> | ||
<Tag class="p-mr-2" value="Primary" rounded></Tag> | ||
<Tag class="p-mr-2" severity="success" value="Success" rounded></Tag> | ||
<Tag class="p-mr-2" severity="info" value="Info" rounded></Tag> | ||
<Tag class="p-mr-2" severity="warning" value="Warning" rounded></Tag> | ||
<Tag severity="danger" value="Danger" rounded></Tag> | ||
|
||
<h5>Icons</h5> | ||
<Tag class="p-mr-2" icon="pi pi-user" value="Primary"></Tag> | ||
<Tag class="p-mr-2" icon="pi pi-check" severity="success" value="Success"></Tag> | ||
<Tag class="p-mr-2" icon="pi pi-info-circle" severity="info" value="Info"></Tag> | ||
<Tag class="p-mr-2" icon="pi pi-exclamation-triangle" severity="warning" value="Warning"></Tag> | ||
<Tag icon="pi pi-times" severity="danger" value="Danger"></Tag> | ||
</div> | ||
</div> | ||
|
||
<TagDoc /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import TagDoc from './TagDoc'; | ||
export default { | ||
components: { | ||
'TagDoc': TagDoc | ||
} | ||
} | ||
</script> |
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,145 @@ | ||
<template> | ||
<div class="content-section documentation"> | ||
<TabView> | ||
<TabPanel header="Documentation"> | ||
<h5>Import</h5> | ||
<CodeHighlight lang="javascript"> | ||
import Tag from 'primevue/tag'; | ||
</CodeHighlight> | ||
|
||
<h5>Getting Started</h5> | ||
<p>Content of the tag is specified using the <i>value</i> property.</p> | ||
<CodeHighlight> | ||
<Tag value="New"></Tag> | ||
</CodeHighlight> | ||
|
||
<h5>Icon</h5> | ||
<p>An icon can also be configured to be displayed next to the value with the <i>icon</i> property.</p> | ||
<CodeHighlight> | ||
<Tag value="New" icon="pi pi-plus"></Tag> | ||
</CodeHighlight> | ||
|
||
<h5>Severities</h5> | ||
<p>Different color options are available as severity levels.</p> | ||
|
||
<ul> | ||
<li>success</li> | ||
<li>info</li> | ||
<li>warning</li> | ||
<li>danger</li> | ||
</ul> | ||
|
||
<h5>Templating</h5> | ||
<p>Content can easily be customized with the default slot instead of using the built-in display.</p> | ||
<CodeHighlight> | ||
<Tag> | ||
Content | ||
</Tag> | ||
</CodeHighlight> | ||
|
||
<h5>Properties</h5> | ||
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p> | ||
<div class="doc-tablewrapper"> | ||
<table class="doc-table"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Default</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>value</td> | ||
<td>any</td> | ||
<td>null</td> | ||
<td>Value to display inside the tag.</td> | ||
</tr> | ||
<tr> | ||
<td>severity</td> | ||
<td>string</td> | ||
<td>null</td> | ||
<td>Severity type of the tag.</td> | ||
</tr> | ||
<tr> | ||
<td>rounded</td> | ||
<td>boolean</td> | ||
<td>false</td> | ||
<td>Whether the corners of the tag are rounded.</td> | ||
</tr> | ||
<tr> | ||
<td>icon</td> | ||
<td>string</td> | ||
<td>null</td> | ||
<td>Icon of the tag to display next to the value.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<h5>Styling</h5> | ||
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p> | ||
<div class="doc-tablewrapper"> | ||
<table class="doc-table"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Element</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>p-tag</td> | ||
<td>Tag element</td> | ||
</tr> | ||
<tr> | ||
<td>p-tag-rounded</td> | ||
<td>Rounded element</td> | ||
</tr> | ||
<tr> | ||
<td>p-tag-icon</td> | ||
<td>Icon of the tag</td> | ||
</tr> | ||
<tr> | ||
<td>p-tag-value</td> | ||
<td>Value of the tag</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<h5>Dependencies</h5> | ||
<p>None.</p> | ||
</TabPanel> | ||
|
||
<TabPanel header="Source"> | ||
<a href="https://github.com/primefaces/primevue/tree/master/src/views/tag" class="btn-viewsource" target="_blank" rel="noopener noreferrer"> | ||
<span>View on GitHub</span> | ||
</a> | ||
<CodeHighlight> | ||
<h5>Tags</h5> | ||
<Tag class="p-mr-2" value="Primary"></Tag> | ||
<Tag class="p-mr-2" severity="success" value="Success"></Tag> | ||
<Tag class="p-mr-2" severity="info" value="Info"></Tag> | ||
<Tag class="p-mr-2" severity="warning" value="Warning"></Tag> | ||
<Tag severity="danger" value="Danger"></Tag> | ||
|
||
<h5>Pills</h5> | ||
<Tag class="p-mr-2" value="Primary" rounded></Tag> | ||
<Tag class="p-mr-2" severity="success" value="Success" rounded></Tag> | ||
<Tag class="p-mr-2" severity="info" value="Info" rounded></Tag> | ||
<Tag class="p-mr-2" severity="warning" value="Warning" rounded></Tag> | ||
<Tag severity="danger" value="Danger" rounded></Tag> | ||
|
||
<h5>Icons</h5> | ||
<Tag class="p-mr-2" icon="pi pi-user" value="Primary"></Tag> | ||
<Tag class="p-mr-2" icon="pi pi-check" severity="success" value="Success"></Tag> | ||
<Tag class="p-mr-2" icon="pi pi-info-circle" severity="info" value="Info"></Tag> | ||
<Tag class="p-mr-2" icon="pi pi-exclamation-triangle" severity="warning" value="Warning"></Tag> | ||
<Tag icon="pi pi-times" severity="danger" value="Danger"></Tag> | ||
</CodeHighlight> | ||
</TabPanel> | ||
</TabView> | ||
</div> | ||
</template> |