-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor card widgets to use a shared base component (#2781)
Supersedes #1801. Implements the proposal from #1801 (comment). ----- Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
- Loading branch information
1 parent
4785cfa
commit dcbc549
Showing
34 changed files
with
726 additions
and
290 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
1 change: 1 addition & 0 deletions
1
bundles/org.openhab.ui/web/src/components/widgets/standard/index.js
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
37 changes: 37 additions & 0 deletions
37
bundles/org.openhab.ui/web/src/components/widgets/standard/oh-card.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<f7-card :no-border="config.noBorder" :no-shadow="config.noShadow" :outline="config.outline" :style="config.style" :class="config.class"> | ||
<slot name="header"> | ||
<f7-card-header v-if="config.title" :style="config.headerStyle" :class="config.headerClass"> | ||
<div>{{ config.title }}</div> | ||
</f7-card-header> | ||
</slot> | ||
<slot name="content-root"> | ||
<f7-card-content @click.native="config.action ? performAction : ''" :style="{ ...contentStyle, ...config.contentStyle}" :class="[ ...(Array.isArray(contentClass) ? contentClass : ['padding']), ...(Array.isArray(config.contentClass) ? config.contentClass : []) ]"> | ||
<slot name="content" /> | ||
</f7-card-content> | ||
</slot> | ||
<slot name="footer"> | ||
<f7-card-footer v-if="config.footer && !Array.isArray(config.footer)"> | ||
{{ config.footer }} | ||
</f7-card-footer> | ||
<f7-card-footer v-else-if="config.footer && Array.isArray(config.footer)"> | ||
<span v-for="text in config.footer" :key="text"> | ||
{{ text }} | ||
</span> | ||
</f7-card-footer> | ||
</slot> | ||
</f7-card> | ||
</template> | ||
|
||
<script> | ||
import mixin from '../widget-mixin' | ||
import { actionsMixin } from '@/components/widgets/widget-actions' | ||
import { OhCardDefinition } from '@/assets/definitions/widgets/standard/cards' | ||
export default { | ||
mixins: [mixin, actionsMixin], | ||
widget: OhCardDefinition, | ||
props: ['context', 'contentStyle', 'contentClass'], | ||
slotProps: ['header', 'content', 'content-root', 'footer'] | ||
} | ||
</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
21 changes: 7 additions & 14 deletions
21
bundles/org.openhab.ui/web/src/components/widgets/standard/oh-colorpicker-card.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
35 changes: 9 additions & 26 deletions
35
bundles/org.openhab.ui/web/src/components/widgets/standard/oh-gauge-card.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
32 changes: 9 additions & 23 deletions
32
bundles/org.openhab.ui/web/src/components/widgets/standard/oh-image-card.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
Oops, something went wrong.