homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_latest/4527.JSqIxrFQ1fA.js

4 lines
20 KiB
JavaScript
Raw Permalink Normal View History

2025-01-10 21:08:35 -08:00
/*! For license information please see 4527.JSqIxrFQ1fA.js.LICENSE.txt */
export const id=4527;export const ids=[4527];export const modules={89833:(t,i,e)=>{e.d(i,{O:()=>d});var r=e(43204),s=e(42977),o=e(5095),a=e(95260),n=e(53180),l=e(10694),h=e(25815);const c={fromAttribute:t=>null!==t&&(""===t||t),toAttribute:t=>"boolean"==typeof t?t?"":null:t};class d extends s.P{constructor(){super(...arguments),this.rows=2,this.cols=20,this.charCounter=!1}render(){const t=this.charCounter&&-1!==this.maxLength,i=t&&"internal"===this.charCounter,e=t&&!i,r=!!this.helper||!!this.validationMessage||e,s={"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":i};return o.dy` <label class="mdc-text-field mdc-text-field--textarea ${(0,n.$)(s)}"> ${this.renderRipple()} ${this.outlined?this.renderOutline():this.renderLabel()} ${this.renderInput()} ${this.renderCharCounter(i)} ${this.renderLineRipple()} </label> ${this.renderHelperText(r,e)} `}renderInput(){const t=this.label?"label":void 0,i=-1===this.minLength?void 0:this.minLength,e=-1===this.maxLength?void 0:this.maxLength,r=this.autocapitalize?this.autocapitalize:void 0;return o.dy` <textarea aria-labelledby="${(0,l.o)(t)}" class="mdc-text-field__input" .value="${(0,h.a)(this.value)}" rows="${this.rows}" cols="${this.cols}" ?disabled="${this.disabled}" placeholder="${this.placeholder}" ?required="${this.required}" ?readonly="${this.readOnly}" minlength="${(0,l.o)(i)}" maxlength="${(0,l.o)(e)}" name="${(0,l.o)(""===this.name?void 0:this.name)}" inputmode="${(0,l.o)(this.inputMode)}" autocapitalize="${(0,l.o)(r)}" @input="${this.handleInputChange}" @blur="${this.onInputBlur}">
</textarea>`}}(0,r.__decorate)([(0,a.IO)("textarea")],d.prototype,"formElement",void 0),(0,r.__decorate)([(0,a.Cb)({type:Number})],d.prototype,"rows",void 0),(0,r.__decorate)([(0,a.Cb)({type:Number})],d.prototype,"cols",void 0),(0,r.__decorate)([(0,a.Cb)({converter:c})],d.prototype,"charCounter",void 0)},96791:(t,i,e)=>{e.d(i,{W:()=>r});const r=e(5095).iv`.mdc-text-field{height:100%}.mdc-text-field__input{resize:none}`},26535:(t,i,e)=>{e.d(i,{e:()=>n});var r=e(15723);function s(t){return"horizontal"===t?"row":"column"}class o extends r.IE{constructor(){super(...arguments),this._itemSize={},this._gaps={},this._padding={}}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{itemSize:{width:"300px",height:"300px"},gap:"8px",padding:"match-gap"})}get _gap(){return this._gaps.row}get _idealSize(){return this._itemSize[(0,r.qF)(this.direction)]}get _idealSize1(){return this._itemSize[(0,r.qF)(this.direction)]}get _idealSize2(){return this._itemSize[(0,r.gu)(this.direction)]}get _gap1(){return this._gaps[(t=this.direction,"horizontal"===t?"column":"row")];var t}get _gap2(){return this._gaps[s(this.direction)]}get _padding1(){const t=this._padding,[i,e]="horizontal"===this.direction?["left","right"]:["top","bottom"];return[t[i],t[e]]}get _padding2(){const t=this._padding,[i,e]="horizontal"===this.direction?["top","bottom"]:["left","right"];return[t[i],t[e]]}set itemSize(t){const i=this._itemSize;"string"==typeof t&&(t={width:t,height:t});const e=parseInt(t.width),r=parseInt(t.height);e!==i.width&&(i.width=e,this._triggerReflow()),r!==i.height&&(i.height=r,this._triggerReflow())}set gap(t){this._setGap(t)}_setGap(t){const i=t.split(" ").map((t=>function(t){return"auto"===t?1/0:parseInt(t)}(t))),e=this._gaps;i[0]!==e.row&&(e.row=i[0],this._triggerReflow()),void 0===i[1]?i[0]!==e.column&&(e.column=i[0],this._triggerReflow()):i[1]!==e.column&&(e.column=i[1],this._triggerReflow())}set padding(t){const i=this._padding,e=t.split(" ").map((t=>function(t){return"match-gap"===t?1/0:parseInt(t)}(t)));1===e.length?(i.top=i.right=i.bottom=i.left=e[0],this._triggerReflow()):2===e.length?(i.top=i.bottom=e[0],i.right=i.left=e[1],this._triggerReflow()):3===e.length?(i.top=e[0],i.right=i.left=e[1],i.bottom=e[2],this._triggerReflow()):4===e.length&&(["top","right","bottom","left"].forEach(((t,r)=>i[t]=e[r])),this._triggerReflow())}}class a extends o{constructor(){super(...arguments),this._metrics=null,this.flex=null,this.justify=null}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{flex:!1,justify:"start"})}set gap(t){super._setGap(t)}_updateLayout(){const t=this.justify,[i,e]=this._padding1,[o,a]=this._padding2;["_gap1","_gap2"].forEach((i=>{const e=this[i];if(e===1/0&&!["space-between","space-around","space-evenly"].includes(t))throw new Error("grid layout: gap can only be set to 'auto' when justify is set to 'space-between', 'space-around' or 'space-evenly'");if(e===1/0&&"_gap2"===i)throw new Error(`grid layout: ${s(this.direction)}-gap cannot be set to 'auto' when direction is set to ${this.direction}`)}));const n=this.flex||["start","center","end"].includes(t),l={rolumns:-1,itemSize1:-1,itemSize2:-1,gap1:this._gap1===1/0?-1:this._gap1,gap2:n?this._gap2:0,padding1:{start:i===1/0?this._gap1:i,end:e===1/0?this._gap1:e},padding2:n?{start:o===1/0?this._gap2:o,end:a===1/0?this._gap2:a}:{start:0,end:0},positions:[]},h=this._viewDim2-l.padding2.start-l.padding2.end;if(h<=0)l.rolumns=0;else{const s=n?l.gap2:0;let o,a=0,c=0;if(h>=this._idealSize2&&(a=Math.floor((h-this._idealSize2)/(this._idealSize2+s))+1,c=a*this._idealSize2+(a-1)*s),this.flex){(h-c)/(this._idealSize2+s)>=.5&&(a+=1),l.rolumns=a,l.itemSize2=Math.round((h-s*(a-1))/a);switch(!0===this.flex?"area":this.flex.preserve){case"aspect-ratio":l.itemSize1=Math.round(this._idealSize1/this._idealSize2*l.itemSize2);break;case(0,r.qF)(this.direction):l.itemSize1=Math.round(this._idealSize1);break;default:l.itemSize1=Math.round(this._idealSize1*this._idealSize2/l.itemSize2)}}else l.itemSize1=this._idealSize1,l.itemSize2=this._idealSize2,l.rolumns=a;if(n){
//# sourceMappingURL=4527.JSqIxrFQ1fA.js.map