UNPKG

iobroker.lovelace

Version:

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

3 lines 13.4 kB
/*! For license information please see 7010.358aedceca30fa49.js.LICENSE.txt */ export const __webpack_ids__=["7010"];export const __webpack_modules__={47711:function(e,r,d){d.d(r,{J:()=>g});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"},_={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"};const m=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 _},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 p=d(57243),u=d(15093),b=d(35359),h=d(20552);class g 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=m,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?p.dy`<mwc-ripple unbounded accent .internalUseStateLayerCustomProperties="${this.useStateLayerCustomProperties}" .disabled="${this.disabled}"></mwc-ripple>`:""}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 p.dy` <div class="mdc-radio ${(0,b.$)(e)}"> <input tabindex="${this.formElementTabIndex}" class="mdc-radio__native-control" type="radio" name="${this.name}" aria-label="${(0,h.o)(this.ariaLabel)}" aria-labelledby="${(0,h.o)(this.ariaLabelledBy)}" .checked="${this.checked}" .value="${this.value}" ?disabled="${this.disabled}" @change="${this.changeHandler}" @focus="${this.handleFocus}" @click="${this.handleClick}" @blur="${this.handleBlur}" @mousedown="${this.handleRippleMouseDown}" @mouseenter="${this.handleRippleMouseEnter}" @mouseleave="${this.handleRippleMouseLeave}" @touchstart="${this.handleRippleTouchStart}" @touchend="${this.handleRippleDeactivate}" @touchcancel="${this.handleRippleDeactivate}"> <div class="mdc-radio__background"> <div class="mdc-radio__outer-circle"></div> <div class="mdc-radio__inner-circle"></div> </div> ${this.renderRipple()} </div>`}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,u.IO)(".mdc-radio")],g.prototype,"mdcRoot",void 0),(0,o.__decorate)([(0,u.IO)("input")],g.prototype,"formElement",void 0),(0,o.__decorate)([(0,u.SB)()],g.prototype,"useStateLayerCustomProperties",void 0),(0,o.__decorate)([(0,u.Cb)({type:Boolean})],g.prototype,"global",void 0),(0,o.__decorate)([(0,u.Cb)({type:Boolean,reflect:!0})],g.prototype,"checked",null),(0,o.__decorate)([(0,u.Cb)({type:Boolean}),(0,a.P)((function(e){this.mdcFoundation.setDisabled(e)}))],g.prototype,"disabled",void 0),(0,o.__decorate)([(0,u.Cb)({type:String}),(0,a.P)((function(e){this._handleUpdatedValue(e)}))],g.prototype,"value",void 0),(0,o.__decorate)([(0,u.Cb)({type:String})],g.prototype,"name",void 0),(0,o.__decorate)([(0,u.Cb)({type:Boolean})],g.prototype,"reducedTouchTarget",void 0),(0,o.__decorate)([(0,u.Cb)({type:Number})],g.prototype,"formElementTabIndex",void 0),(0,o.__decorate)([(0,u.SB)()],g.prototype,"focused",void 0),(0,o.__decorate)([(0,u.SB)()],g.prototype,"shouldRenderRipple",void 0),(0,o.__decorate)([(0,u.GC)("mwc-ripple")],g.prototype,"ripple",void 0),(0,o.__decorate)([i.L,(0,u.Cb)({attribute:"aria-label"})],g.prototype,"ariaLabel",void 0),(0,o.__decorate)([i.L,(0,u.Cb)({attribute:"aria-labelledby"})],g.prototype,"ariaLabelledBy",void 0),(0,o.__decorate)([(0,u.hO)({passive:!0})],g.prototype,"handleRippleTouchStart",null)},81577:function(e,r,d){d.d(r,{W:()=>o});const o=d(57243).iv`.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}@media 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%}@media 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)}@media 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.358aedceca30fa49.js.map