Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add material design loading icon #2727

Merged
merged 4 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/components/LoadingIcon/LoadingIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!--
- @copyright Copyright (c) 2022 Raimund Schlüßler <raimund.schluessler@mailbox.org>
-
- @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<docs>
# Usage

```
<LoadingIcon />
<LoadingIcon :size="64" fill-color="var(--color-primary-element)" title="Loading with primary color" />
```
</docs>

<template>
<Loading :size="size" :fill-color="fillColor" :title="title" />
</template>

<script>
import Loading from 'vue-material-design-icons/Loading'

export default {
name: 'LoadingIcon',
components: {
Loading,
},
props: {
/**
* Specify the size of the loading icon.
*/
size: {
type: Number,
default: 20,
},
/**
* Overwrites the default color. Necessary for dark backgrounds.
*/
fillColor: {
type: String,
default: 'var(--color-loading-dark)',
},
/**
* Specify what is loading.
*/
title: {
type: String,
default: '',
},
},
}
</script>

<style lang="scss" scoped>
.material-design-icon::v-deep svg {
animation: rotate var(--animation-duration, 0.8s) linear infinite;
}
</style>
25 changes: 25 additions & 0 deletions src/components/LoadingIcon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @copyright Copyright (c) 2022 Raimund Schlüßler <raimund.schluessler@mailbox.org>
*
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

import LoadingIcon from './LoadingIcon.vue'

export default LoadingIcon
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export { default as DatetimePicker } from './DatetimePicker/index.js'
export { default as EmptyContent } from './EmptyContent/index.js'
export { default as ListItem } from './ListItem/index.js'
export { default as ListItemIcon } from './ListItemIcon/index.js'
export { default as LoadingIcon } from './LoadingIcon/index.js'
export { default as Modal } from './Modal/index.js'
export { default as Multiselect } from './Multiselect/index.js'
export { default as MultiselectTags } from './MultiselectTags/index.js'
Expand Down