Handle automation and dashboard drag and drop at the element level (#22300)

* Handle drag and drop at action, condition, trigger level

* Clean item path

* Clean item path

* Fix selectors

* Clean selector config

* Remove enhancedSelector

* Add option row component

* Fix DnD inside option sequence or condition

* Add comments

* Remove item path logic from the dashboard too

* Fix floor/area drag and drop

* Avoid UI jump in area dashboard

* Remove unused import

* Add comment
This commit is contained in:
Paul Bottein
2024-10-30 09:44:38 +01:00
committed by GitHub
parent 51f89b00c1
commit bc11c0b3ac
34 changed files with 909 additions and 907 deletions

View File

@@ -15,7 +15,6 @@ import {
extractSearchParam,
removeSearchParam,
} from "../../../common/url/search-params";
import { nestedArrayMove } from "../../../common/util/array-move";
import "../../../components/ha-card";
import "../../../components/ha-icon-button";
import "../../../components/ha-markdown";
@@ -163,7 +162,6 @@ export class HaManualScriptEditor extends LitElement {
.actions=${this.config.sequence || []}
.path=${["sequence"]}
@value-changed=${this._sequenceChanged}
@item-moved=${this._itemMoved}
.hass=${this.hass}
.narrow=${this.narrow}
.disabled=${this.disabled}
@@ -185,21 +183,6 @@ export class HaManualScriptEditor extends LitElement {
});
}
private _itemMoved(ev: CustomEvent): void {
ev.stopPropagation();
const { oldIndex, newIndex, oldPath, newPath } = ev.detail;
const updatedConfig = nestedArrayMove(
this.config,
oldIndex,
newIndex,
oldPath,
newPath
);
fireEvent(this, "value-changed", {
value: updatedConfig,
});
}
static get styles(): CSSResultGroup {
return [
haStyle,