Hello all,
I have designed a widget but have some issue with the alignment…
The f7-segmented component is overlapping with the webframe … How can I align it the right way?
uid: widget_steckdosenewnew
tags: []
props:
parameters:
- context: item
description: A actual power item to display
label: Item
name: itemActualPower
required: false
type: TEXT
- context: item
description: A total power item to display
label: Item
name: itemTotalePower
required: false
type: TEXT
- context: item
description: A daily total power item to display
label: Item
name: itemDailyTotalPower
required: false
type: TEXT
- context: item
description: the switch state
label: Item
name: itemSwitch
required: false
type: TEXT
- description: URL to show in the frame
label: Source URL
name: URL
required: true
type: TEXT
- default: from=now-6h&to=now;6h,from=now-12h&to=now;12h,from=now-1d&to=now;24h,from=now/d&to=now/d;Day,from=now-3d&to=now;Last 3 Days,from=now-7d&to=now;Last 7 Days,from=now-14d&to=now;Last 14 Days
description: Comma-separated List of options. Example "from=now-6h&to=now;-6h,from=now-1d/d&to=now-1d/d;yesterday" for past "6h" and "yesterday". First entry is default.
label: Time range options
name: timerange
required: true
type: TEXT
parameterGroups: []
timestamp: Feb 12, 2024, 3:13:58 PM
component: f7-card
config:
backdrop: true
class:
- card-expandable-animate-width
expandable: true
style:
height: 200px
width: auto
swipeToClose: true
slots:
default:
- component: oh-button
config:
class:
- cell-open-button
- card-opened-fade-out
color: black
iconF7: expand
iconSize: 30px
style:
padding-bottom: 35px
padding-top: 10px
position: absolute
right: 0
top: 0
z-index: 999
- component: f7-card-content
config:
style:
width: 100%
slots:
default:
- component: oh-icon
config:
height: 80px
icon: poweroutlet
state: =items[props.itemSwitch].state
style:
opacity: 40%
position: absolute
right: 16px
top: 120px
width: 80px
- component: oh-button
config:
class:
- card-opened-fade-in
- cell-close-button
- card-close
color: black
iconF7: xmark_circle_fill
iconSize: 30px
style:
padding-bottom: 35px
padding-top: 10px
position: absolute
right: 0
top: 0
z-index: 999
- component: oh-link
config:
action: toggle
actionCommand: ON
actionCommandAlt: OFF
actionItem: =props.itemSwitch
class:
- card-prevent-open
style:
height: 100%
left: 0
position: absolute
top: 0
width: 100%
z-index: 0
- component: f7-block
config:
class:
- no-padding
style:
height: 200px
margin: 0px
slots:
default:
- component: f7-row
config:
bgcolor: green
style:
height: 30px
slots:
default:
- component: Label
config:
style:
font-size: 25px
font-weight: 600
text: steckdose
- component: f7-row
config:
bgcolor: green
style:
flex-wrap: nowrap
height: 80px
white-space: nowrap
slots:
default:
- component: f7-col
config:
width: 30
slots:
default:
- component: f7-chip
config:
action: toggle
actionCommand: ON
actionCommandAlt: OFF
actionItem: =props.itemSwitch
color: "=(items[props.itemSwitch].state === 'ON') ? 'green' : 'red'"
text: "=(items[props.itemSwitch].state === 'ON') ? 'AN' : 'AUS'"
- component: f7-col
slots:
default:
- component: oh-trend
config:
style:
height: 100px
- component: f7-row
config:
style:
bgcolor: green
height: 66px
overflow: hidden
width: 100%
slots:
default:
- component: f7-col
config:
style:
align-self: flex-end
flex-wrap: nowrap
slots:
default:
- component: f7-row
config:
class:
- justify-content-flex-start
style:
flex-wrap: nowrap
width: 100%
slots:
default:
- component: f7-icon
config:
color: blue
f7: chart_bar
size: 20px
style:
margin-top: 0px
visible: true
- component: Label
config:
style:
font-size: 14px
font-weight: 600
margin-left: 5px
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
text: =(Number.parseFloat(items[props.itemActualPower].state)).toFixed(1) + 'W'
visible: true
- component: f7-icon
config:
color: blue
f7: chart_bar_circle
size: 20px
style:
margin-left: 10px
margin-top: 0px
visible: true
- component: Label
config:
style:
font-size: 14px
font-weight: 600
margin-left: 5px
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
text: =(Number.parseFloat(items[props.itemDailyTotalPower].state)).toFixed(1) + 'kWh'
visible: true
- component: f7-row
config:
class:
- justify-content-flex-start
style:
flex-wrap: nowrap
height: 20px
margin-top: 5px
slots:
default:
- component: f7-icon
config:
color: white
material: restore
size: 18px
style:
margin-left: 0px
margin-top: 0px
- component: Label
config:
style:
color: white
font-size: 12px
margin-left: 8px
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
text: ""
- component: f7-icon
config:
color: gray
f7: chart_bar_square_fill
size: 15px
style:
margin-left: 10px
margin-top: 2px
- component: Label
config:
style:
color: gray
font-size: 12px
margin-left: 3px
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
text: =(Number.parseFloat(items[props.itemTotalePower].state)).toFixed(1) + 'kWh'
- component: f7-block
config:
class:
- card-prevent-open
- card-content-padding
style:
height: 200px
slots:
default:
- component: oh-list
config:
class:
- padding
slots:
default:
- component: oh-toggle-item
config:
color: green
icon: oh:poweroutlet
item: =props.itemSwitch
title: Steckdose
- component: oh-label-item
config:
color: blue
icon: f7:chart_bar_circle
item: =props.itemDailyTotalPower
title: Daily Total Power
- component: oh-label-item
config:
color: blue
icon: f7:chart_bar
item: =props.itemActualPower
title: Actual Power
- component: oh-label-item
config:
color: blue
icon: f7:chart_bar_square_fill
item: =props.itemTotalePower
title: Totale Power
- component: oh-webframe-card
config:
borders: false
noBorder: false
noShadow: true
height: 100px
src: =props.URL.replace('{period}', vars.selectedPeriod || [props.timerange.split(',')[0].split(';')[0]])
- component: f7-segmented
config:
round: false
outline: false
class:
- padding-bottom-half
style:
margin-left: 10px
margin-right: 10px
--f7-button-font-size: 14px
--f7-button-text-color: "=themeOptions.dark === 'light' ? 'black' : 'white'"
--f7-button-text-transform: none
--f7-button-border-radius: 4px
--f7-button-outline-border-width: 1px
--f7-button-font-weight: 300
--f7-button-padding-vertical: 0px
--f7-button-padding-horizontal: 0px
slots:
default:
- component: oh-repeater
config:
sourceType: range
for: size
fragment: true
slots:
default:
- component: oh-repeater
config:
fragment: true
for: period
in: =[props.timerange.split(",")[loop.size].split(";")[1]]
slots:
default:
- component: oh-button
config:
text: =loop.period
fill: "=(([props.timerange.split(',')[loop.size].split(';')[0]] == vars.selectedPeriod) || (props.timerange.split(',')[0].split(';')[1] === loop.period) && !vars.selectedPeriod) ? true : false"
round: false
outline: true
style:
--f7-button-border-color: var(--f7-card-outline-border-color)
action: variable
actionVariable: selectedPeriod
actionVariableValue: =props.timerange.split(",")[loop.size].split(";")[0]