mirror of
				https://github.com/home-assistant/frontend.git
				synced 2025-10-30 22:19:55 +00:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			20251001.3
			...
			improve_ne
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | da58dfe133 | 
| @@ -147,12 +147,13 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|     if (!this.lovelace) return nothing; |     if (!this.lovelace) return nothing; | ||||||
|  |  | ||||||
|     const sections = this.sections; |     const sections = this.sections; | ||||||
|     const totalSectionCount = |  | ||||||
|       this._sectionColumnCount + (this.lovelace?.editMode ? 1 : 0); |  | ||||||
|     const editMode = this.lovelace.editMode; |     const editMode = this.lovelace.editMode; | ||||||
|  |  | ||||||
|     const maxColumnCount = this._columnsController.value ?? 1; |     const maxColumnCount = this._columnsController.value ?? 1; | ||||||
|  |     const totalSectionCount = this._sectionColumnCount; | ||||||
|  |  | ||||||
|  |     const showExtraColumn = | ||||||
|  |       totalSectionCount < maxColumnCount && totalSectionCount > 0 && editMode; | ||||||
|     return html` |     return html` | ||||||
|       <hui-view-badges |       <hui-view-badges | ||||||
|         .hass=${this.hass} |         .hass=${this.hass} | ||||||
| @@ -174,6 +175,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|         <div |         <div | ||||||
|           class="container ${classMap({ |           class="container ${classMap({ | ||||||
|             dense: Boolean(this._config?.dense_section_placement), |             dense: Boolean(this._config?.dense_section_placement), | ||||||
|  |             "extra-column": showExtraColumn, | ||||||
|           })}" |           })}" | ||||||
|           style=${styleMap({ |           style=${styleMap({ | ||||||
|             "--total-section-count": totalSectionCount, |             "--total-section-count": totalSectionCount, | ||||||
| @@ -250,13 +252,6 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|                   .rollback=${false} |                   .rollback=${false} | ||||||
|                 > |                 > | ||||||
|                   <div class="create-section-container"> |                   <div class="create-section-container"> | ||||||
|                     <div class="drop-helper" aria-hidden="true"> |  | ||||||
|                       <p> |  | ||||||
|                         ${this.hass.localize( |  | ||||||
|                           "ui.panel.lovelace.editor.section.drop_card_create_section" |  | ||||||
|                         )} |  | ||||||
|                       </p> |  | ||||||
|                     </div> |  | ||||||
|                     <button |                     <button | ||||||
|                       class="create-section" |                       class="create-section" | ||||||
|                       @click=${this._createSection} |                       @click=${this._createSection} | ||||||
| @@ -456,6 +451,10 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|  |  | ||||||
|     .container { |     .container { | ||||||
|       --column-count: min(var(--max-column-count), var(--total-section-count)); |       --column-count: min(var(--max-column-count), var(--total-section-count)); | ||||||
|  |       --container-max-width: calc( | ||||||
|  |         var(--column-count) * var(--column-max-width) + | ||||||
|  |           (var(--column-count) - 1) * var(--column-gap) | ||||||
|  |       ); | ||||||
|       display: grid; |       display: grid; | ||||||
|       align-items: start; |       align-items: start; | ||||||
|       justify-content: center; |       justify-content: center; | ||||||
| @@ -465,11 +464,14 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|       padding: var(--row-gap) var(--column-gap); |       padding: var(--row-gap) var(--column-gap); | ||||||
|       box-sizing: content-box; |       box-sizing: content-box; | ||||||
|       margin: 0 auto; |       margin: 0 auto; | ||||||
|       max-width: calc( |       max-width: var(--container-max-width); | ||||||
|         var(--column-count) * var(--column-max-width) + |  | ||||||
|           (var(--column-count) - 1) * var(--column-gap) |  | ||||||
|       ); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     .container.extra-column { | ||||||
|  |       grid-template-columns: repeat(var(--column-count), 1fr) 76px; | ||||||
|  |       max-width: calc(var(--column-gap) + 76px + var(--container-max-width)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     .container.dense { |     .container.dense { | ||||||
|       grid-auto-flow: row dense; |       grid-auto-flow: row dense; | ||||||
|     } |     } | ||||||
| @@ -483,38 +485,20 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|       position: relative; |       position: relative; | ||||||
|       display: flex; |       display: flex; | ||||||
|       flex-direction: column; |       flex-direction: column; | ||||||
|       margin-top: 36px; |       margin-top: 34px; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     .create-section-container .card { |     .create-section-container .card { | ||||||
|       display: none; |       display: none; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     .create-section-container:has(.card) .drop-helper { |     .create-section-container:has(.card) .create-section:after { | ||||||
|       display: flex; |       content: ""; | ||||||
|     } |       position: absolute; | ||||||
|     .create-section-container:has(.card) .create-section { |       display: block; | ||||||
|       display: none; |       inset: 0; | ||||||
|     } |       background: var(--primary-color); | ||||||
|  |       opacity: 0.12; | ||||||
|     .drop-helper { |  | ||||||
|       display: none; |  | ||||||
|       flex-direction: column; |  | ||||||
|       align-items: center; |  | ||||||
|       justify-content: center; |  | ||||||
|       position: relative; |  | ||||||
|       outline: none; |  | ||||||
|       background: none; |  | ||||||
|       cursor: pointer; |  | ||||||
|       border-radius: var(--ha-card-border-radius, 12px); |  | ||||||
|       border: 2px dashed var(--primary-color); |  | ||||||
|       height: calc(var(--row-height) + 2 * (var(--row-gap) + 2px)); |  | ||||||
|       padding: 8px; |  | ||||||
|       box-sizing: border-box; |  | ||||||
|       width: 100%; |  | ||||||
|       --ha-ripple-color: var(--primary-color); |  | ||||||
|       --ha-ripple-hover-opacity: 0.04; |  | ||||||
|       --ha-ripple-pressed-opacity: 0.12; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     .drop-helper p { |     .drop-helper p { | ||||||
| @@ -537,7 +521,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement { | |||||||
|       height: calc(var(--row-height) + 2 * (var(--row-gap) + 2px)); |       height: calc(var(--row-height) + 2 * (var(--row-gap) + 2px)); | ||||||
|       padding: 8px; |       padding: 8px; | ||||||
|       box-sizing: border-box; |       box-sizing: border-box; | ||||||
|       width: 100%; |       width: 76px; | ||||||
|       --ha-ripple-color: var(--primary-color); |       --ha-ripple-color: var(--primary-color); | ||||||
|       --ha-ripple-hover-opacity: 0.04; |       --ha-ripple-hover-opacity: 0.04; | ||||||
|       --ha-ripple-pressed-opacity: 0.12; |       --ha-ripple-pressed-opacity: 0.12; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user