iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 13.6 kB
JavaScript
/*! For license information please see 7010.20b7b0762b72b107.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["7010"],{47711:function(e,r,d){d.d(r,{J:()=>k});d(71695),d(19423),d(47021);var o=d(9065),i=(d(16060),d(4428)),c=d(88618),a=d(78611),t=d(99152),n=d(91532),l=d(80573),s={NATIVE_CONTROL_SELECTOR:".mdc-radio__native-control"},m={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"};const _=function(e){function r(d){return e.call(this,(0,o.__assign)((0,o.__assign)({},r.defaultAdapter),d))||this}return(0,o.__extends)(r,e),Object.defineProperty(r,"cssClasses",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return s},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlDisabled:function(){}}},enumerable:!1,configurable:!0}),r.prototype.setDisabled=function(e){var d=r.cssClasses.DISABLED;this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(d):this.adapter.removeClass(d)},r}(l.K);var u=d(57243),p=d(50778),b=d(35359),h=d(20552);let g,v,f=e=>e;class k extends c.Wg{constructor(){super(...arguments),this._checked=!1,this.useStateLayerCustomProperties=!1,this.global=!1,this.disabled=!1,this.value="on",this.name="",this.reducedTouchTarget=!1,this.mdcFoundationClass=_,this.formElementTabIndex=0,this.focused=!1,this.shouldRenderRipple=!1,this.rippleElement=null,this.rippleHandlers=new n.A((()=>(this.shouldRenderRipple=!0,this.ripple.then((e=>{this.rippleElement=e})),this.ripple)))}get checked(){return this._checked}set checked(e){var r,d;const o=this._checked;e!==o&&(this._checked=e,this.formElement&&(this.formElement.checked=e),null===(r=this._selectionController)||void 0===r||r.update(this),!1===e&&(null===(d=this.formElement)||void 0===d||d.blur()),this.requestUpdate("checked",o),this.dispatchEvent(new Event("checked",{bubbles:!0,composed:!0})))}_handleUpdatedValue(e){this.formElement.value=e}renderRipple(){return this.shouldRenderRipple?(0,u.dy)(g||(g=f`<mwc-ripple unbounded accent .internalUseStateLayerCustomProperties="${0}" .disabled="${0}"></mwc-ripple>`),this.useStateLayerCustomProperties,this.disabled):""}get isRippleActive(){var e;return(null===(e=this.rippleElement)||void 0===e?void 0:e.isActive)||!1}connectedCallback(){super.connectedCallback(),this._selectionController=t.V.getController(this),this._selectionController.register(this),this._selectionController.update(this)}disconnectedCallback(){this._selectionController.unregister(this),this._selectionController=void 0}focus(){this.formElement.focus()}createAdapter(){return Object.assign(Object.assign({},(0,c.qN)(this.mdcRoot)),{setNativeControlDisabled:e=>{this.formElement.disabled=e}})}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleClick(){this.formElement.focus()}handleBlur(){this.focused=!1,this.formElement.blur(),this.rippleHandlers.endFocus()}setFormData(e){this.name&&this.checked&&e.append(this.name,this.value)}render(){const e={"mdc-radio--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-radio--disabled":this.disabled};return(0,u.dy)(v||(v=f` <div class="mdc-radio ${0}"> <input tabindex="${0}" class="mdc-radio__native-control" type="radio" name="${0}" aria-label="${0}" aria-labelledby="${0}" .checked="${0}" .value="${0}" ?disabled="${0}" ="${0}" ="${0}" ="${0}" ="${0}" ="${0}" ="${0}" ="${0}" ="${0}" ="${0}" ="${0}"> <div class="mdc-radio__background"> <div class="mdc-radio__outer-circle"></div> <div class="mdc-radio__inner-circle"></div> </div> ${0} </div>`),(0,b.$)(e),this.formElementTabIndex,this.name,(0,h.o)(this.ariaLabel),(0,h.o)(this.ariaLabelledBy),this.checked,this.value,this.disabled,this.changeHandler,this.handleFocus,this.handleClick,this.handleBlur,this.handleRippleMouseDown,this.handleRippleMouseEnter,this.handleRippleMouseLeave,this.handleRippleTouchStart,this.handleRippleDeactivate,this.handleRippleDeactivate,this.renderRipple())}handleRippleMouseDown(e){const r=()=>{window.removeEventListener("mouseup",r),this.handleRippleDeactivate()};window.addEventListener("mouseup",r),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}changeHandler(){this.checked=this.formElement.checked}}(0,o.__decorate)([(0,p.IO)(".mdc-radio")],k.prototype,"mdcRoot",void 0),(0,o.__decorate)([(0,p.IO)("input")],k.prototype,"formElement",void 0),(0,o.__decorate)([(0,p.SB)()],k.prototype,"useStateLayerCustomProperties",void 0),(0,o.__decorate)([(0,p.Cb)({type:Boolean})],k.prototype,"global",void 0),(0,o.__decorate)([(0,p.Cb)({type:Boolean,reflect:!0})],k.prototype,"checked",null),(0,o.__decorate)([(0,p.Cb)({type:Boolean}),(0,a.P)((function(e){this.mdcFoundation.setDisabled(e)}))],k.prototype,"disabled",void 0),(0,o.__decorate)([(0,p.Cb)({type:String}),(0,a.P)((function(e){this._handleUpdatedValue(e)}))],k.prototype,"value",void 0),(0,o.__decorate)([(0,p.Cb)({type:String})],k.prototype,"name",void 0),(0,o.__decorate)([(0,p.Cb)({type:Boolean})],k.prototype,"reducedTouchTarget",void 0),(0,o.__decorate)([(0,p.Cb)({type:Number})],k.prototype,"formElementTabIndex",void 0),(0,o.__decorate)([(0,p.SB)()],k.prototype,"focused",void 0),(0,o.__decorate)([(0,p.SB)()],k.prototype,"shouldRenderRipple",void 0),(0,o.__decorate)([(0,p.GC)("mwc-ripple")],k.prototype,"ripple",void 0),(0,o.__decorate)([i.L,(0,p.Cb)({attribute:"aria-label"})],k.prototype,"ariaLabel",void 0),(0,o.__decorate)([i.L,(0,p.Cb)({attribute:"aria-labelledby"})],k.prototype,"ariaLabelledBy",void 0),(0,o.__decorate)([(0,p.hO)({passive:!0})],k.prototype,"handleRippleTouchStart",null)},81577:function(e,r,d){d.d(r,{W:()=>i});let o;const i=(0,d(57243).iv)(o||(o=(e=>e)`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc((40px - 20px)/ 2)}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.54)}.mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#018786;border-color:var(--mdc-theme-secondary,#018786)}.mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:#018786;border-color:var(--mdc-theme-secondary,#018786)}.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.38)}.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0,0,0,.38)}.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0,0,0,.38)}.mdc-radio .mdc-radio__background::before{background-color:#018786;background-color:var(--mdc-theme-secondary,#018786)}.mdc-radio .mdc-radio__background::before{top:calc(-1 * (40px - 20px)/ 2);left:calc(-1 * (40px - 20px)/ 2);width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:calc((40px - 40px)/ 2);right:calc((40px - 40px)/ 2);left:calc((40px - 40px)/ 2);width:40px;height:40px} screen and (forced-colors:active),(-ms-high-contrast:active){.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0,0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0s cubic-bezier(.4, 0, .6, 1),transform 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0,0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0s cubic-bezier(.4, 0, .6, 1),border-color 120ms 0s cubic-bezier(.4, 0, .6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px)/ 2);right:calc((40px - 48px)/ 2);left:calc((40px - 48px)/ 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:100%;width:100%} screen and (forced-colors:active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:calc(100% + 4px);width:calc(100% + 4px)} screen and (forced-colors:active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(.5);transition:transform 120ms 0s cubic-bezier(0, 0, .2, 1),border-color 120ms 0s cubic-bezier(0, 0, .2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0s cubic-bezier(0, 0, .2, 1),transform 120ms 0s cubic-bezier(0, 0, .2, 1)}:host{display:inline-block;outline:0}.mdc-radio{vertical-align:bottom}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unchecked-color,rgba(0,0,0,.54))}.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color,rgba(0,0,0,.38))}.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color,rgba(0,0,0,.38))}.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-color,rgba(0,0,0,.38))}`))}}]);
//# sourceMappingURL=7010.20b7b0762b72b107.js.map