homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_latest/6251.lvvrL2NdD6A.js

3 lines
24 KiB
JavaScript
Raw Permalink Normal View History

2025-01-10 21:08:35 -08:00
/*! For license information please see 6251.lvvrL2NdD6A.js.LICENSE.txt */
export const id=6251;export const ids=[6251];export const modules={62871:(e,r,i)=>{i.d(r,{K:()=>a});const a=e=>{switch(e.language){case"cz":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},92295:(e,r,i)=>{var a=i(309),t=i(14271),s=i(5095),n=i(95260),o=i(3712);(0,a.Z)([(0,n.Mo)("ha-button")],(function(e,r){return{F:class extends r{constructor(...r){super(...r),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[o.W,s.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)}`]}]}}),t.z)},36251:(e,r,i)=>{i.r(r),i.d(r,{HaFileSelector:()=>h});var a=i(309),t=i(34541),s=i(47838),n=i(5095),o=i(95260),l=i(18394);var d=i(11285),c=(i(82692),i(53180)),m=(i(92295),i(54371),i(62871)),p=i(4771);const u="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",f="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z";(0,a.Z)([(0,o.Mo)("ha-file-upload")],(function(e,r){class i extends r{constructor(...r){super(...r),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"accept",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"supports",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"multiple",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"uploading",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"progress",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"auto-open-file-dialog"})],key:"autoOpenFileDialog",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_drag",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("#input")],key:"_input",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,t.Z)((0,s.Z)(i.prototype),"firstUpdated",this).call(this,e),this.autoOpenFileDialog&&this._openFilePicker()}},{kind:"method",key:"render",value:function(){var e,r,i,a,t;return n.dy` ${this.uploading?n.dy`<div class="container"> <div class="row"> <span class="header">${this.value?null===(e=this.hass)||void 0===e?void 0:e.localize("ui.components.file-upload.uploading_name",{name:this.value.toString()}):null===(r=this.hass)||void 0===r?void 0:r.localize("ui.components.file-upload.uploading")}</span> ${this.progress?n.dy`<span class="progress">${this.progress}${(0,m.K)(this.hass.locale)}%</span>`:""} </div> <mwc-linear-progress .indeterminate="${!this.progress}" .progress="${this.progress?this.progress/100:void 0}"></mwc-linear-progress> </div>`:n.dy`<label for="${this.value?"":"input"}" class="container ${(0,c.$)({dragged:this._drag,multiple:this.multiple,value:Boolean(this.value)})}" @drop="${this._handleDrop}" @dragenter="${this._handleDragStart}" @dragover="${this._handleDragStart}" @dragleave="${this._handleDragEnd}" @dragend="${this._handleDragEnd}">${this.value?"string"==typeof this.value?n.dy`<div class="row"> <div class="value" @click="${this._openFilePicker}"> <ha-svg-icon .path="${this.icon||f}"></ha-svg-icon> ${this.value} </div> <ha-icon-button @click="${this._clearValue}" .label="${(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.delete"))||"Delete"}" .path="${u}"></ha-icon-button> </div>`:(this.value instanceof FileList?Array.from(this.value):(0,p.r)(this.value)).map((e=>{var r;return n.dy`<div class="row"> <div class="value" @click="${this._openFilePicker}"> <ha-svg-icon .path="${this.icon||f}"></ha-svg-icon> ${e.name} - ${((e=0,r=2)=>{if(0===e)return"0
//# sourceMappingURL=6251.lvvrL2NdD6A.js.map