x-weather
Version:
A collection of web components implementing portions of the OpenWeatherMap API.
2 lines (1 loc) • 2.22 kB
JavaScript
import"./utilities.js";import"./types.js";import"./updateCurrentWeather.js";import"./getCurrentWeather.js";import"./updateForecastWeather.js";import"./getForecastWeather.js";import"./index.js";import{_ as t}from"./_rollupPluginBabelHelpers-5bd7183e.js";import{L as e,c as r,h as i}from"./lit-element-ae08ccac.js";import"./XDateTime.js";import"./XWeatherItem.js";import"./XWeatherItemTemperature.js";import"./connect-mixin-144a42a2.js";import"./redux-a2f99696.js";import"./configureStore.js";import"./initialState.js";import"./utilities2.js";import"./current.js";import"./forecast.js";import"./preferences.js";import"./index2.js";import"./root.js";import"./middleware.js";import{updateLocation as s,getCurrentWeather as o,getForecastWeather as a}from"./dispatchers.js";import"./XCurrentTemperature.js";import"./XCurrent.js";import"./XForecast.js";import"./XLocation.js";function n(){var e=t(["\n <div>\n Please make sure required attributes (appid, host, latitude, longitude, placename) are set on\n <x-weather>.\n </div>\n "]);return n=function(){return e},e}function p(){var e=t(["\n <x-location></x-location>\n <slot></slot>\n "]);return p=function(){return e},e}function u(){var e=t(["\n :host {\n display: block;\n }\n "]);return u=function(){return e},e}var m=class extends e{static get styles(){return r(u())}static get properties(){return{appid:{type:String,reflect:!1},host:{type:String,reflect:!0},latitude:{type:Number,reflect:!0},longitude:{type:Number,reflect:!0},placename:{type:String,reflect:!0}}}constructor(){super(),this.appid=void 0,this.host="api.openweathermap.org",this.latitude=void 0,this.longitude=void 0,this.placename=void 0}_hasRequiredAttributes(){return this.appid&&this.host&&this.latitude&&this.longitude&&this.placename}firstUpdated(){this._hasRequiredAttributes()&&(s({latitude:this.latitude,longitude:this.longitude,placename:this.placename}),o({appid:this.appid,host:this.host}),a({appid:this.appid,host:this.host}))}render(){return this._hasRequiredAttributes()?i(p()):i(n())}};customElements.get("x-weather")||customElements.define("x-weather",m);export default m;export{m as XWeather};