UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 7.55 kB
/*! For license information please see 7774.b02e7e2f91eeab36.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[7774],{89865:function(t,o,e){e.a(t,async function(t,o){try{e(18111),e(61701),e(62953);var a=e(40445),i=(e(22395),e(5124)),r=e(67576),n=e(1087),l=e(18350),s=(e(67094),t([l]));l=(s.then?(await s)():s)[0];let u,d,h,c,p=t=>t;class v extends i.WF{render(){return(0,i.qy)(u||(u=p` <wa-button-group childSelector="ha-button"> ${0} </wa-button-group> `),this.buttons.map(t=>(0,i.qy)(d||(d=p`<ha-button iconTag="ha-svg-icon" class="icon" .variant="${0}" .size="${0}" .value="${0}" @click="${0}" .title="${0}" .appearance="${0}"> ${0} </ha-button>`),this.active===t.value&&this.activeVariant?this.activeVariant:this.variant,this.size,t.value,this._handleClick,t.label,this.active===t.value?"accent":"filled",t.iconPath?(0,i.qy)(h||(h=p`<ha-svg-icon aria-label="${0}" .path="${0}"></ha-svg-icon>`),t.label,t.iconPath):t.label)))}_handleClick(t){this.active=t.currentTarget.value,(0,n.r)(this,"value-changed",{value:this.active})}constructor(...t){super(...t),this.size="medium",this.nowrap=!1,this.fullWidth=!1,this.variant="brand"}}v.styles=(0,i.AH)(c||(c=p`:host{--mdc-icon-size:var(--button-toggle-icon-size, 20px)}:host([no-wrap]) wa-button-group::part(base){flex-wrap:nowrap}wa-button-group{padding:var(--ha-button-toggle-group-padding)}:host([full-width]) wa-button-group,:host([full-width]) wa-button-group::part(base){width:100%}:host([full-width]) ha-button{flex:1}`)),(0,a.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"buttons",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"active",void 0),(0,a.Cg)([(0,r.MZ)({reflect:!0})],v.prototype,"size",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"no-wrap"})],v.prototype,"nowrap",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"full-width"})],v.prototype,"fullWidth",void 0),(0,a.Cg)([(0,r.MZ)()],v.prototype,"variant",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"active-variant"})],v.prototype,"activeVariant",void 0),v=(0,a.Cg)([(0,r.EM)("ha-button-toggle-group")],v),o()}catch(u){o(u)}})},79949:function(t,o,e){e.a(t,async function(t,a){try{e.r(o),e.d(o,{HaButtonToggleSelector:function(){return v}});e(26910),e(18111),e(7588),e(61701),e(62953);var i=e(40445),r=e(5124),n=e(67576),l=e(1087),s=e(52220),u=e(89865),d=t([u]);u=(d.then?(await d)():d)[0];let h,c,p=t=>t;class v extends r.WF{render(){var t,o,e;const a=(null===(t=this.selector.button_toggle)||void 0===t||null===(t=t.options)||void 0===t?void 0:t.map(t=>"object"==typeof t?t:{value:t,label:t}))||[],i=null===(o=this.selector.button_toggle)||void 0===o?void 0:o.translation_key;this.localizeValue&&i&&a.forEach(t=>{const o=this.localizeValue(`${i}.options.${t.value}`);o&&(t.label=o)}),null!==(e=this.selector.button_toggle)&&void 0!==e&&e.sort&&a.sort((t,o)=>(0,s.SH)(t.label,o.label,this.hass.locale.language));const n=a.map(t=>({label:t.label,value:t.value}));return(0,r.qy)(h||(h=p` ${0} <ha-button-toggle-group .buttons="${0}" .active="${0}" @value-changed="${0}"></ha-button-toggle-group> `),this.label,n,this.value,this._valueChanged)}_valueChanged(t){var o,e;t.stopPropagation();const a=(null===(o=t.detail)||void 0===o?void 0:o.value)||t.target.value;this.disabled||void 0===a||a===(null!==(e=this.value)&&void 0!==e?e:"")||(0,l.r)(this,"value-changed",{value:a})}constructor(...t){super(...t),this.disabled=!1,this.required=!0}}v.styles=(0,r.AH)(c||(c=p`:host{position:relative;display:flex;justify-content:space-between;flex-wrap:wrap;gap:var(--ha-space-2);align-items:center}@media all and (max-width:600px){ha-button-toggle-group{flex:1}}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"selector",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"value",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"helper",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"localizeValue",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"required",void 0),v=(0,i.Cg)([(0,n.EM)("ha-selector-button_toggle")],v),a()}catch(h){a(h)}})},22395:function(t,o,e){e(62953);var a=e(5124),i=e(67576),r=e(717);let n;var l=(0,a.AH)(n||(n=(t=>t)`:host{display:inline-flex}.button-group{display:flex;position:relative;isolation:isolate;flex-wrap:wrap}@media (hover:hover){.button-group::slotted(:hover),.button-group>:hover{z-index:1}}.button-group::slotted(:focus),.button-group::slotted([aria-checked=true]),.button-group::slotted([checked]),.button-group>:focus,.button-group>[aria-checked=true],.button-group>[checked]{z-index:2!important}:host([orientation=horizontal]) .button-group{flex-direction:row}:host([orientation=vertical]) .button-group{flex-direction:column}:host([orientation=horizontal]){--_button-horizontal-indent:var(--wa-form-control-border-width);--_button-horizontal-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}:host([orientation=vertical]){--_button-vertical-indent:var(--wa-form-control-border-width);--_button-vertical-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}::slotted(:not(:first-child):not(:last-child)){--_button-start-start-radius:0;--_button-start-end-radius:0;--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:first-child:not(:last-child)){--_button-start-end-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-end-start-radius:0}:host([orientation=vertical]) ::slotted(:first-child:not(:last-child)){--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=vertical]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-start-end-radius:0}`));let s,u=t=>t;var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,c=(t,o,e,a)=>{for(var i,r=a>1?void 0:a?h(o,e):o,n=t.length-1;n>=0;n--)(i=t[n])&&(r=(a?i(o,e,r):i(r))||r);return a&&r&&d(o,e,r),r};let p=class extends r.A{updated(t){super.updated(t),t.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}handleFocus(t){const o=v(t.target,this.childSelector);null==o||o.classList.add("button-focus")}handleBlur(t){const o=v(t.target,this.childSelector);null==o||o.classList.remove("button-focus")}handleMouseOver(t){const o=v(t.target,this.childSelector);null==o||o.classList.add("button-hover")}handleMouseOut(t){const o=v(t.target,this.childSelector);null==o||o.classList.remove("button-hover")}render(){return(0,a.qy)(s||(s=u` <slot part="base" class="button-group" role="${0}" aria-label="${0}" aria-orientation="${0}" @focusout="${0}" @focusin="${0}" @mouseover="${0}" @mouseout="${0}"></slot> `),this.disableRole?"presentation":"group",this.label,this.orientation,this.handleBlur,this.handleFocus,this.handleMouseOver,this.handleMouseOut)}constructor(){super(...arguments),this.disableRole=!1,this.hasOutlined=!1,this.label="",this.orientation="horizontal",this.childSelector="wa-button, wa-radio-button"}};function v(t,o){var e;return null!==(e=t.closest(o))&&void 0!==e?e:t.querySelector(o)}p.css=[l],c([(0,i.P)("slot")],p.prototype,"defaultSlot",2),c([(0,i.wk)()],p.prototype,"disableRole",2),c([(0,i.wk)()],p.prototype,"hasOutlined",2),c([(0,i.MZ)()],p.prototype,"label",2),c([(0,i.MZ)({reflect:!0})],p.prototype,"orientation",2),c([(0,i.MZ)()],p.prototype,"childSelector",2),p=c([(0,i.EM)("wa-button-group")],p)}}]);