mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #3829 - Add new Icon components
This commit is contained in:
parent
2817a3268e
commit
01c151b799
139 changed files with 2050 additions and 0 deletions
68
components/lib/baseicon/BaseIcon.vue
Normal file
68
components/lib/baseicon/BaseIcon.vue
Normal file
|
@ -0,0 +1,68 @@
|
|||
<script>
|
||||
import { ObjectUtils } from 'primevue/utils';
|
||||
|
||||
export default {
|
||||
name: 'BaseIcon',
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
value: undefined
|
||||
},
|
||||
spin: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
pti() {
|
||||
const isLabelEmpty = ObjectUtils.isEmpty(this.label);
|
||||
|
||||
return {
|
||||
class: [
|
||||
'p-icon',
|
||||
{
|
||||
'p-icon-spin': this.spin
|
||||
}
|
||||
],
|
||||
role: !isLabelEmpty ? 'img' : undefined,
|
||||
'aria-hidden': isLabelEmpty
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
/* Theme */
|
||||
.p-icon {
|
||||
display: inline-block;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
.p-icon-spin {
|
||||
-webkit-animation: p-icon-spin 2s infinite linear;
|
||||
animation: p-icon-spin 2s infinite linear;
|
||||
}
|
||||
|
||||
@-webkit-keyframes p-icon-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes p-icon-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
</style>
|
8
components/lib/baseicon/package.json
Normal file
8
components/lib/baseicon/package.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"main": "./baseicon.cjs.js",
|
||||
"module": "./baseicon.esm.js",
|
||||
"unpkg": "./baseicon.min.js",
|
||||
"browser": {
|
||||
"./sfc": "./BaseIcon.vue"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue