@@ -17,55 +17,56 @@ import setupCustomlocalize from "../localize";
1717import { computeActionsFormSchema } from "../shared/config" ;
1818
1919const actions : UiAction [ ] = [ "none" , "perform-action" ] ;
20- const computeSchema = memoizeOne ( ( t : LocalizeFunc ) : HaFormSchema [ ] => {
21- return [
22- {
23- name : "entity" ,
24- selector : { entity : { } } ,
25- } ,
26- {
27- type : "grid" ,
28- name : "" ,
29- schema : [
30- {
31- name : "name" ,
32- selector : { text : { } } ,
33- } ,
34- {
35- name : "icon" ,
36- selector : { icon : { } } ,
37- context : {
38- icon_entity : "entity" ,
20+ const computeSchema = memoizeOne (
21+ ( t : LocalizeFunc ) : HaFormSchema [ ] =>
22+ [
23+ {
24+ name : "entity" ,
25+ selector : { entity : { } } ,
26+ } ,
27+ {
28+ type : "grid" ,
29+ name : "" ,
30+ schema : [
31+ {
32+ name : "name" ,
33+ selector : { text : { } } ,
3934 } ,
40- } ,
41- ] ,
42- } ,
43- {
44- name : "default" ,
45- selector : { template : { } } ,
46- } ,
47- {
48- name : "selector" ,
49- selector : { selector : { } } ,
50- } ,
51- {
52- type : "expandable" ,
53- name : "" ,
54- title : t ( "editor.form.actions_heading.title" ) ,
55- description : {
56- suffix : t ( "editor.form.actions_heading.description" ) ,
35+ {
36+ name : "icon" ,
37+ selector : { icon : { } } ,
38+ context : {
39+ icon_entity : "entity" ,
40+ } ,
41+ } ,
42+ ] ,
5743 } ,
58- icon : "mdi:playlist-edit" ,
59- schema : [
60- {
61- name : "spread_values_to_data" ,
62- selector : { boolean : { } } ,
44+ {
45+ name : "default" ,
46+ selector : { template : { } } ,
47+ } ,
48+ {
49+ name : "selector" ,
50+ selector : { selector : { } } ,
51+ } ,
52+ {
53+ type : "expandable" ,
54+ name : "" ,
55+ title : t ( "editor.form.actions_heading.title" ) ,
56+ description : {
57+ suffix : t ( "editor.form.actions_heading.description" ) ,
6358 } ,
64- ...computeActionsFormSchema ( "change_action" , actions ) ,
65- ] ,
66- } ,
67- ] as const ;
68- } ) ;
59+ icon : "mdi:playlist-edit" ,
60+ schema : [
61+ {
62+ name : "spread_values_to_data" ,
63+ selector : { boolean : { } } ,
64+ } ,
65+ ...computeActionsFormSchema ( "change_action" , actions ) ,
66+ ] ,
67+ } ,
68+ ] as const
69+ ) ;
6970
7071@customElement ( "form-entity-row-editor" )
7172export class FormEntityRowEditor extends LitElement implements LovelaceRowEditor {
0 commit comments