7 lines
No EOL
17 KiB
JavaScript
7 lines
No EOL
17 KiB
JavaScript
/*! For license information please see 1049.ub548fxmuzk.js.LICENSE.txt */
|
||
export const id=1049;export const ids=[1049];export const modules={92295:(e,t,i)=>{var d=i(309),l=i(14271),a=i(5095),o=i(95260),n=i(3712);(0,d.Z)([(0,o.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[n.W,a.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}`]}]}}),l.z)},1049:(e,t,i)=>{i.r(t),i.d(t,{HaTextSelector:()=>s});var d=i(309),l=i(5095),a=i(95260),o=i(4771),n=i(18394),r=(i(54371),i(29950));i(92295),i(51520);(0,d.Z)([(0,a.Mo)("ha-multi-textfield")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"inputType",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"inputSuffix",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"inputPrefix",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"addLabel",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"removeLabel",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:"item-index",type:Boolean})],key:"itemIndex",value:()=>!1},{kind:"method",key:"render",value:function(){var e,t,i;return l.dy` ${this._items.map(((e,t)=>{var i,d,a;const o=""+(this.itemIndex?` ${t+1}`:"");return l.dy` <div class="layout horizontal center-center row"> <ha-textfield .suffix="${this.inputSuffix}" .prefix="${this.inputPrefix}" .type="${this.inputType}" .autocomplete="${this.autocomplete}" .disabled="${this.disabled}" dialogInitialFocus="${t}" .index="${t}" class="flex-auto" .label="${""+(this.label?`${this.label}${o}`:"")}" .value="${e}" ?data-last="${t===this._items.length-1}" @input="${this._editItem}" @keydown="${this._keyDown}"></ha-textfield> <ha-icon-button .disabled="${this.disabled}" .index="${t}" slot="navigationIcon" .label="${null!==(i=null!==(d=this.removeLabel)&&void 0!==d?d:null===(a=this.hass)||void 0===a?void 0:a.localize("ui.common.remove"))&&void 0!==i?i:"Remove"}" @click="${this._removeItem}" .path="${"M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z"}"></ha-icon-button> </div> `}))} <div class="layout horizontal center-center"> <ha-button @click="${this._addItem}" .disabled="${this.disabled}"> ${null!==(e=null!==(t=this.addLabel)&&void 0!==t?t:null===(i=this.hass)||void 0===i?void 0:i.localize("ui.common.add"))&&void 0!==e?e:"Add"} <ha-svg-icon slot="icon" .path="${"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}"></ha-svg-icon> </ha-button> </div> `}},{kind:"get",key:"_items",value:function(){var e;return null!==(e=this.value)&&void 0!==e?e:[]}},{kind:"method",key:"_addItem",value:async function(){var e;const t=[...this._items,""];this._fireChanged(t),await this.updateComplete;const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("ha-textfield[data-last]");null==i||i.focus()}},{kind:"method",key:"_editItem",value:async function(e){const t=e.target.index,i=[...this._items];i[t]=e.target.value,this._fireChanged(i)}},{kind:"method",key:"_keyDown",value:async function(e){"Enter"===e.key&&(e.stopPropagation(),this._addItem())}},{kind:"method",key:"_removeItem",value:async function(e){const t=e.target.index,i=[...this._items];i.splice(t,1),this._fireChanged(i)}},{kind:"method",key:"_fireChanged",value:function(e){this.value=e,(0,n.B)(this,"value-changed",{value:e})}},{kind:"get",static:!0,key:"styles",value:function(){return[r.Qx,l.iv`.row{margin-bottom:8px}ha-textfield{display:block}ha-icon-button{display:block}ha-button{margin-left:8px}`]}}]}}),l.oi);i(99539);let s=(0,d.Z)([(0,a.Mo)("ha-selector-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"name",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,a.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"required",value:()=>!0},{kind:"field",decorators:[(0,a.SB)()],key:"_unmaskedPassword",value:()=>!1},{kind:"method",key:"focus",value:async function(){var e;await this.updateComplete,null===(e=this.renderRoot.querySelector("ha-textarea, ha-textfield"))||void 0===e||e.focus()}},{kind:"method",key:"render",value:function(){var e,t,i,d,a,n,r,s,c,u,h,p,f,v,x;return null!==(e=this.selector.text)&&void 0!==e&&e.multiple?l.dy` <ha-multi-textfield .hass="${this.hass}" .value="${(0,o.r)(null!==(u=this.value)&&void 0!==u?u:[])}" .disabled="${this.disabled}" .label="${this.label}" .inputType="${null===(h=this.selector.text)||void 0===h?void 0:h.type}" .inputSuffix="${null===(p=this.selector.text)||void 0===p?void 0:p.suffix}" .inputPrefix="${null===(f=this.selector.text)||void 0===f?void 0:f.prefix}" .autocomplete="${null===(v=this.selector.text)||void 0===v?void 0:v.autocomplete}" @value-changed="${this._handleChange}"> </ha-multi-textfield> `:null!==(t=this.selector.text)&&void 0!==t&&t.multiline?l.dy`<ha-textarea .name="${this.name}" .label="${this.label}" .placeholder="${this.placeholder}" .value="${this.value||""}" .helper="${this.helper}" helperPersistent .disabled="${this.disabled}" @input="${this._handleChange}" autocapitalize="none" .autocomplete="${null===(x=this.selector.text)||void 0===x?void 0:x.autocomplete}" spellcheck="false" .required="${this.required}" autogrow></ha-textarea>`:l.dy`<ha-textfield .name="${this.name}" .value="${this.value||""}" .placeholder="${this.placeholder||""}" .helper="${this.helper}" helperPersistent .disabled="${this.disabled}" .type="${this._unmaskedPassword?"text":null===(i=this.selector.text)||void 0===i?void 0:i.type}" @input="${this._handleChange}" .label="${this.label||""}" .prefix="${null===(d=this.selector.text)||void 0===d?void 0:d.prefix}" .suffix="${"password"===(null===(a=this.selector.text)||void 0===a?void 0:a.type)?l.dy`<div style="width:24px"></div>`:null===(n=this.selector.text)||void 0===n?void 0:n.suffix}" .required="${this.required}" .autocomplete="${null===(r=this.selector.text)||void 0===r?void 0:r.autocomplete}"></ha-textfield> ${"password"===(null===(s=this.selector.text)||void 0===s?void 0:s.type)?l.dy`<ha-icon-button toggles .label="${(null===(c=this.hass)||void 0===c?void 0:c.localize(this._unmaskedPassword?"ui.components.selectors.text.hide_password":"ui.components.selectors.text.show_password"))||(this._unmaskedPassword?"Hide password":"Show password")}" @click="${this._toggleUnmaskedPassword}" .path="${this._unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}"></ha-icon-button>`:""}`}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",key:"_handleChange",value:function(e){var t,i;let d=null!==(t=null===(i=e.detail)||void 0===i?void 0:i.value)&&void 0!==t?t:e.target.value;this.value!==d&&((""===d||Array.isArray(d)&&0===d.length)&&!this.required&&(d=void 0),(0,n.B)(this,"value-changed",{value:d}))}},{kind:"get",static:!0,key:"styles",value:function(){return l.iv`:host{display:block;position:relative}ha-textarea,ha-textfield{width:100%}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`}}]}}),l.oi)},99539:(e,t,i)=>{var d=i(309),l=i(34541),a=i(47838),o=i(89833),n=i(31338),r=i(96791),s=i(5095),c=i(95260),u=i(67684);(0,d.Z)([(0,c.Mo)("ha-textarea")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,c.Cb)({type:Boolean,reflect:!0})],key:"autogrow",value:()=>!1},{kind:"method",key:"firstUpdated",value:function(){(0,l.Z)((0,a.Z)(i.prototype),"firstUpdated",this).call(this),this.setAttribute("dir",u.E.document.dir)}},{kind:"method",key:"updated",value:function(e){(0,l.Z)((0,a.Z)(i.prototype),"updated",this).call(this,e),this.autogrow&&e.has("value")&&(this.mdcRoot.dataset.value=this.value+'="')}},{kind:"field",static:!0,key:"styles",value:()=>[n.W,r.W,s.iv`:host([autogrow]) .mdc-text-field{position:relative;min-height:74px;min-width:178px;max-height:200px}:host([autogrow]) .mdc-text-field:after{content:attr(data-value);margin-top:23px;margin-bottom:9px;line-height:1.5rem;min-height:42px;padding:0px 32px 0 16px;letter-spacing:var(
|
||
--mdc-typography-subtitle1-letter-spacing,
|
||
.009375em
|
||
);visibility:hidden;white-space:pre-wrap}:host([autogrow]) .mdc-text-field__input{position:absolute;height:calc(100% - 32px)}:host([autogrow]) .mdc-text-field.mdc-text-field--no-label:after{margin-top:16px;margin-bottom:16px}:host([dir=rtl]) .mdc-floating-label{right:16px;left:initial}`]}]}}),o.O)},51520:(e,t,i)=>{var d=i(309),l=i(34541),a=i(47838),o=i(42977),n=i(31338),r=i(5095),s=i(95260),c=i(67684);(0,d.Z)([(0,s.Mo)("ha-textfield")],(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:"invalid",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,s.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,l.Z)((0,a.Z)(i.prototype),"updated",this).call(this,e),(e.has("invalid")&&(this.invalid||void 0!==e.get("invalid"))||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||"Invalid":""),this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return r.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[n.W,r.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:var(--direction)}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}`,"rtl"===c.E.document.dir?r.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__affix--suffix,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl}`:r.iv``]}]}}),o.P)},89833:(e,t,i)=>{i.d(t,{O:()=>u});var d=i(43204),l=i(42977),a=i(5095),o=i(95260),n=i(53180),r=i(10694),s=i(25815);const c={fromAttribute:e=>null!==e&&(""===e||e),toAttribute:e=>"boolean"==typeof e?e?"":null:e};class u extends l.P{constructor(){super(...arguments),this.rows=2,this.cols=20,this.charCounter=!1}render(){const e=this.charCounter&&-1!==this.maxLength,t=e&&"internal"===this.charCounter,i=e&&!t,d=!!this.helper||!!this.validationMessage||i,l={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--end-aligned":this.endAligned,"mdc-text-field--with-internal-counter":t};return a.dy` <label class="mdc-text-field mdc-text-field--textarea ${(0,n.$)(l)}"> ${this.renderRipple()} ${this.outlined?this.renderOutline():this.renderLabel()} ${this.renderInput()} ${this.renderCharCounter(t)} ${this.renderLineRipple()} </label> ${this.renderHelperText(d,i)} `}renderInput(){const e=this.label?"label":void 0,t=-1===this.minLength?void 0:this.minLength,i=-1===this.maxLength?void 0:this.maxLength,d=this.autocapitalize?this.autocapitalize:void 0;return a.dy` <textarea aria-labelledby="${(0,r.o)(e)}" class="mdc-text-field__input" .value="${(0,s.a)(this.value)}" rows="${this.rows}" cols="${this.cols}" ?disabled="${this.disabled}" placeholder="${this.placeholder}" ?required="${this.required}" ?readonly="${this.readOnly}" minlength="${(0,r.o)(t)}" maxlength="${(0,r.o)(i)}" name="${(0,r.o)(""===this.name?void 0:this.name)}" inputmode="${(0,r.o)(this.inputMode)}" autocapitalize="${(0,r.o)(d)}" @input="${this.handleInputChange}" @blur="${this.onInputBlur}">
|
||
</textarea>`}}(0,d.__decorate)([(0,o.IO)("textarea")],u.prototype,"formElement",void 0),(0,d.__decorate)([(0,o.Cb)({type:Number})],u.prototype,"rows",void 0),(0,d.__decorate)([(0,o.Cb)({type:Number})],u.prototype,"cols",void 0),(0,d.__decorate)([(0,o.Cb)({converter:c})],u.prototype,"charCounter",void 0)},96791:(e,t,i)=>{i.d(t,{W:()=>d});const d=i(5095).iv`.mdc-text-field{height:100%}.mdc-text-field__input{resize:none}`}};
|
||
//# sourceMappingURL=1049.ub548fxmuzk.js.map
|