iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
8 lines • 12.8 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["38336"],{97828:function(e,t,i){var a=i(61701),n=(i(71695),i(49278),i(11740),i(47021),i(87319),i(57243)),d=i(50778),l=i(20552),r=i(36522),s=i(49976);i(92824),i(23334),i(83166),i(34363);let o,c,u,h,m,p,f,b,y,v=e=>e;(0,a.Z)([(0,d.Mo)("ha-base-time-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"auto-validate",type:Boolean})],key:"autoValidate",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"format",value(){return 12}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"days",value(){return 0}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"hours",value(){return 0}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"minutes",value(){return 0}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"seconds",value(){return 0}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"milliseconds",value(){return 0}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"dayLabel",value(){return""}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hourLabel",value(){return""}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"minLabel",value(){return""}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"secLabel",value(){return""}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"millisecLabel",value(){return""}},{kind:"field",decorators:[(0,d.Cb)({attribute:"enable-second",type:Boolean})],key:"enableSecond",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"enable-millisecond",type:Boolean})],key:"enableMillisecond",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"enable-day",type:Boolean})],key:"enableDay",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-hours-limit",type:Boolean})],key:"noHoursLimit",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"amPm",value(){return"AM"}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.dy)(o||(o=v` ${0} <div class="time-input-wrap-wrap"> <div class="time-input-wrap"> ${0} <ha-textfield id="hour" type="number" inputmode="numeric" .value="${0}" .label="${0}" name="hours" ="${0}" ="${0}" no-spinner .required="${0}" .autoValidate="${0}" maxlength="2" max="${0}" min="0" .disabled="${0}" suffix=":" class="hasSuffix"> </ha-textfield> <ha-textfield id="min" type="number" inputmode="numeric" .value="${0}" .label="${0}" ="${0}" ="${0}" name="minutes" no-spinner .required="${0}" .autoValidate="${0}" maxlength="2" max="59" min="0" .disabled="${0}" .suffix="${0}" class="${0}"> </ha-textfield> ${0} ${0} ${0} </div> ${0} </div> ${0} `),this.label?(0,n.dy)(c||(c=v`<label>${0}${0}</label>`),this.label,this.required?" *":""):n.Ld,this.enableDay?(0,n.dy)(u||(u=v` <ha-textfield id="day" type="number" inputmode="numeric" .value="${0}" .label="${0}" name="days" ="${0}" ="${0}" no-spinner .required="${0}" .autoValidate="${0}" min="0" .disabled="${0}" suffix=":" class="hasSuffix"> </ha-textfield> `),this.days.toFixed(),this.dayLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):n.Ld,this.hours.toFixed(),this.hourLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,(0,l.o)(this._hourMax),this.disabled,this._formatValue(this.minutes),this.minLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableSecond?":":"",this.enableSecond?"has-suffix":"",this.enableSecond?(0,n.dy)(h||(h=v`<ha-textfield id="sec" type="number" inputmode="numeric" .value="${0}" .label="${0}" ="${0}" ="${0}" name="seconds" no-spinner .required="${0}" .autoValidate="${0}" maxlength="2" max="59" min="0" .disabled="${0}" .suffix="${0}" class="${0}"> </ha-textfield>`),this._formatValue(this.seconds),this.secLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableMillisecond?":":"",this.enableMillisecond?"has-suffix":""):n.Ld,this.enableMillisecond?(0,n.dy)(m||(m=v`<ha-textfield id="millisec" type="number" .value="${0}" .label="${0}" ="${0}" ="${0}" name="milliseconds" no-spinner .required="${0}" .autoValidate="${0}" maxlength="3" max="999" min="0" .disabled="${0}"> </ha-textfield>`),this._formatValue(this.milliseconds,3),this.millisecLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):n.Ld,!this.clearable||this.required||this.disabled?n.Ld:(0,n.dy)(p||(p=v`<ha-icon-button label="clear" ="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"),24===this.format?n.Ld:(0,n.dy)(f||(f=v`<ha-select .required="${0}" .value="${0}" .disabled="${0}" name="amPm" naturalMenuWidth fixedMenuPosition ="${0}" ="${0}"> <mwc-list-item value="AM">AM</mwc-list-item> <mwc-list-item value="PM">PM</mwc-list-item> </ha-select>`),this.required,this.amPm,this.disabled,this._valueChanged,s.U),this.helper?(0,n.dy)(b||(b=v`<ha-input-helper-text>${0}</ha-input-helper-text>`),this.helper):n.Ld)}},{kind:"method",key:"_clearValue",value:function(){(0,r.B)(this,"value-changed")}},{kind:"method",key:"_valueChanged",value:function(e){const t=e.currentTarget;this[t.name]="amPm"===t.name?t.value:Number(t.value);const i={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(i.days=this.days),12===this.format&&(i.amPm=this.amPm),(0,r.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_onFocus",value:function(e){e.currentTarget.select()}},{kind:"method",key:"_formatValue",value:function(e,t=2){return e.toString().padStart(t,"0")}},{kind:"get",key:"_hourMax",value:function(){if(!this.noHoursLimit)return 12===this.format?12:23}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(y||(y=v`:host([clearable]){position:relative}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;flex:var(--time-input-flex,unset);border-radius:var(--mdc-shape-small,4px) var(--mdc-shape-small,4px) 0 0;overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-textfield{width:55px;flex-grow:1;text-align:center;--mdc-shape-small:0;--text-field-appearance:none;--text-field-padding:0 4px;--text-field-suffix-padding-left:2px;--text-field-suffix-padding-right:0;--text-field-text-align:center}ha-textfield.hasSuffix{--text-field-padding:0 0 0 4px}ha-textfield:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-textfield:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-select{--mdc-shape-small:0;width:85px}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction);display:flex;align-items:center;background-color:var(--mdc-text-field-fill-color,#f5f5f5);border-bottom-style:solid;border-bottom-width:1px}label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:var(
--mdc-typography-body2-letter-spacing,
.0178571429em
);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:normal}`))}}]}}),n.oi)},34363:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),d=i(50778);let l,r,s=e=>e;(0,a.Z)([(0,d.Mo)("ha-input-helper-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return(0,n.dy)(l||(l=s`<slot></slot>`))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=s`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px}`))}}]}}),n.oi)},92824:function(e,t,i){var a=i(61701),n=i(72621),d=(i(71695),i(40251),i(47021),i(60930)),l=i(9714),r=i(57243),s=i(50778),o=i(22381),c=i(76320);i(23334);let u,h,m,p,f=e=>e;(0,a.Z)([(0,s.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"clearable",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return(0,r.dy)(u||(u=f` ${0} ${0} `),(0,n.Z)(i,"render",this,3)([]),this.clearable&&!this.required&&!this.disabled&&this.value?(0,r.dy)(h||(h=f`<ha-icon-button label="clear" ="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"):r.Ld)}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?(0,r.dy)(m||(m=f`<span class="mdc-select__icon"><slot name="icon"></slot></span>`)):r.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){var e;((0,n.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow)&&(null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector(".mdc-select__selected-text-container"))||void 0===e||e.classList.add("inline-arrow"))}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".mdc-select__selected-text-container");this.inlineArrow?null==e||e.classList.add("inline-arrow"):null==e||e.classList.remove("inline-arrow")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,o.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value(){return[l.W,(0,r.iv)(p||(p=f`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`))]}}]}}),d.K)}}]);
//# sourceMappingURL=38336.b9ea8f086d39f13e.js.map