()
| 92 | } |
| 93 | |
| 94 | public render(): TemplateResult { |
| 95 | const localize = this.localize || this._localize!; |
| 96 | return html` |
| 97 | ${this.uploading |
| 98 | ? html`<div class="container"> |
| 99 | <div class="uploading"> |
| 100 | <span class="header" |
| 101 | >${this.uploadingLabel || |
| 102 | (this.value |
| 103 | ? localize("ui.components.file-upload.uploading_name", { |
| 104 | name: this._name, |
| 105 | }) |
| 106 | : localize("ui.components.file-upload.uploading"))}</span |
| 107 | > |
| 108 | ${this.progress |
| 109 | ? html`<div class="progress"> |
| 110 | ${this.progress}${this._locale && |
| 111 | blankBeforePercent(this._locale)}% |
| 112 | </div>` |
| 113 | : nothing} |
| 114 | </div> |
| 115 | <ha-progress-bar |
| 116 | .indeterminate=${!this.progress} |
| 117 | .value=${this.progress} |
| 118 | loading |
| 119 | ></ha-progress-bar> |
| 120 | </div>` |
| 121 | : html`<label |
| 122 | for=${this.value ? "" : "input"} |
| 123 | class="container ${classMap({ |
| 124 | dragged: this._drag, |
| 125 | multiple: this.multiple, |
| 126 | value: Boolean(this.value), |
| 127 | })}" |
| 128 | @drop=${this._handleDrop} |
| 129 | @dragenter=${this._handleDragStart} |
| 130 | @dragover=${this._handleDragStart} |
| 131 | @dragleave=${this._handleDragEnd} |
| 132 | @dragend=${this._handleDragEnd} |
| 133 | >${!this.value |
| 134 | ? html`<ha-button |
| 135 | size="s" |
| 136 | appearance="filled" |
| 137 | @click=${this._openFilePicker} |
| 138 | > |
| 139 | <ha-svg-icon |
| 140 | slot="start" |
| 141 | .path=${this.icon || mdiFileUpload} |
| 142 | ></ha-svg-icon> |
| 143 | ${this.label || localize("ui.components.file-upload.label")} |
| 144 | </ha-button> |
| 145 | <span class="secondary" |
| 146 | >${this.secondary || |
| 147 | localize("ui.components.file-upload.secondary")}</span |
| 148 | > |
| 149 | <span class="supports">${this.supports}</span>` |
| 150 | : typeof this.value === "string" |
| 151 | ? html`<div class="row"> |
nothing calls this directly
no test coverage detected