UNPKG

@larva.io/webcomponents

Version:

Fentrica SmartUnits WebComponents package

5 lines 5.42 kB
/*! * (C) Fentrica http://fentrica.com - Seee LICENSE.md */ import{r as e,h as a}from"./p-C4h1muVj.js";const i="slot-fb[hidden],slot[hidden]{display:initial !important}lar-icon{fill:var(--lar-text-color, #fff);stroke:var(--lar-text-color, #fff)}.suninfo .sunrise>*,.suninfo .sunset>*{vertical-align:middle}.suninfo{height:2rem;width:50%;margin:0 auto 1rem auto}.suninfo .sunrise,.suninfo .sunset{display:inline-block;width:50%;text-align:center}h4{margin:0.2rem 0 0 0}.circle{background-color:var(--lar-background-color-step-200, #333333) !important;border-radius:50%;display:inline-block;padding:0.5rem;width:2rem;height:2rem;margin-right:1rem}.circle lar-icon{display:block;width:100%;height:100%;color:var(--lar-text-color, #fff) !important}lar-list-item{background-color:var(--lar-background-color-step-100, rgb(25.5, 25.5, 25.5)) !important;color:var(--lar-text-color, #fff) !important}";const t=class{constructor(a){e(this,a);this.parsedData={}}componentWillLoad(){this.parseData()}parseData(){if(typeof this.data==="string"){try{this.parsedData=JSON.parse(this.data)}catch(e){console.error("Failed to parse weather data:",e);this.parsedData={}}}else{this.parsedData=this.data||{}}}render(){return[a("div",{key:"41da9057208e01a7956b48d8d5d6fbf06b1ccdb1",class:"suninfo"},this.parsedData.sunrise&&a("div",{key:"be8777fe226d3c954d1aa7cda4edf1c9d3b2c14a",class:"sunrise"},a("lar-icon",{key:"a885904dd31babf2a1c3eda2a79e7f2055f2fc0c",size:"large",icon:"wi-sunrise"}),a("span",{key:"abd566d8215a526b6fcea8b895c3bd7f5747635b"},this.parsedData.sunrise)),this.parsedData.sunset&&a("div",{key:"871c869650ddc70a7fe60bef2b67e1a6a6ef1dd8",class:"sunset"},a("lar-icon",{key:"0dbd1ce208b974e0b6570b6b44ead84738ffdb47",size:"large",icon:"wi-sunset"}),a("span",{key:"9f3500813af6cf3a368d2ce1d15b16bc93cdc2ee"},this.parsedData.sunset))),a("lar-list",{key:"56133403afb444dd47a56710bad060e7714ccba1",class:"detailinfo"},this.parsedData.temperature!==undefined&&a("lar-weather-item",{key:"2f01679f1a215f6fbbd4540552a90676884a4eb8",icon:"wi-thermometer-exterior",name:"weather.temperature",value:`${this.parsedData.temperature}°`}),this.parsedData.temperatureFeelsLike!==undefined&&a("lar-weather-item",{key:"e03c98c73b739c3a59e520d768601c56a4ab9524",icon:"wi-thermometer-exterior",name:"weather.temperatureFeelsLike",value:`${this.parsedData.temperatureFeelsLike}°`}),this.parsedData.drewPoint!==undefined&&a("lar-weather-item",{key:"3ba96054f8c5146a1a1f150ab5e927621fef2128",icon:"wi-raindrop",name:"weather.drewPoint",value:`${this.parsedData.drewPoint}°`}),this.parsedData.solarIrradiation!==undefined&&a("lar-weather-item",{key:"362ff9f7b5d9928b17b9dc6499c29eb5284a7269",icon:"wi-day-sunny",name:"weather.solarIrradiation",value:`${this.parsedData.solarIrradiation}%`}),this.parsedData.windSpeed!==undefined&&a("lar-weather-item",{key:"76d848a1ec6cd44918ebae975b5ca67ac0381873",icon:"wi-strong-wind",name:"weather.windSpeed",value:`${this.parsedData.windSpeed}m/s`}),this.parsedData.windDirection!==undefined&&a("lar-weather-item",{key:"54054ab9d1e162931fd0f68fabb4f5a45988dc98",icon:"wi-wind-deg",name:"weather.windDirection",rotateIcon:this.parsedData.windDirection,value:`${this.parsedData.windDirection}°`}),this.parsedData.daylight!==undefined&&typeof this.parsedData.daylight==="number"&&a("lar-weather-item",{key:"4e781f51f744f9bd810b35a506ce14031e781be9",icon:"wi-day-sunny",name:"weather.daylight",value:`${this.parsedData.daylight}lx`}),this.parsedData.daylight!==undefined&&typeof this.parsedData.daylight==="boolean"&&a("lar-weather-item",{key:"6a91df1e31fd1a6093f6ae684837893686215c1f",icon:"wi-day-sunny",name:"weather.daylight",value:`${this.parsedData.daylight}`}),this.parsedData.humidity!==undefined&&a("lar-weather-item",{key:"05bace71f421bb6c84127dff0200d872aa1e7f10",icon:"wi-humidity",name:"weather.humidity",value:`${this.parsedData.humidity}%`}),this.parsedData.pressure!==undefined&&a("lar-weather-item",{key:"4dc111977dda20572e3f5fe3ef27edf08dcb5b60",icon:"wi-barometer",name:"weather.pressure",value:`${this.parsedData.pressure}hPa`}),this.parsedData.rain!==undefined&&typeof this.parsedData.rain==="number"&&a("lar-weather-item",{key:"1d83fddff35770b6a6b79397a371f5aea5c3376c",icon:"wi-raindrops",name:"weather.rain",value:`${this.parsedData.rain}mm`}),this.parsedData.rain!==undefined&&typeof this.parsedData.rain==="boolean"&&a("lar-weather-item",{key:"c9483c37d5193552db365208dad2d2c29ce7567a",icon:"wi-raindrops",name:"weather.rain",value:`${this.parsedData.rain}`}),this.parsedData.snow!==undefined&&typeof this.parsedData.snow==="number"&&a("lar-weather-item",{key:"da7d3c04bc0655b5cac9d1a44d846d4a907bb217",icon:"wi-snow",name:"weather.snow",value:`${this.parsedData.snow}mm`}),this.parsedData.snow!==undefined&&typeof this.parsedData.snow==="boolean"&&a("lar-weather-item",{key:"4211f2e2b384a42a17a3913241b3763159db9cfd",icon:"wi-snow",name:"weather.snow",value:`${this.parsedData.snow}`}),this.parsedData.storm!==undefined&&a("lar-weather-item",{key:"cfd06c2ff7f0acda4a9d0c2266251a9a1cc22a4a",icon:"wi-storm-warning",name:"weather.storm",value:`${this.parsedData.storm}`}),this.parsedData.fog!==undefined&&a("lar-weather-item",{key:"4af61c04f010c2cf81dc3e5e80af0ec54e918578",icon:"wi-fog",name:"weather.fog",value:`${this.parsedData.fog}`}))]}static get watchers(){return{data:["parseData"]}}};t.style=i;export{t as lar_weather_content}; //# sourceMappingURL=p-2ea71da4.entry.js.map