@@ -45,6 +45,9 @@ function childTags(element: Element | null | undefined): SCLTag[] {
45
45
/** [[`Substation`]] plugin subeditor for editing `Substation` sections. */
46
46
@customElement ( 'substation-editor' )
47
47
export class SubstationEditor extends LitElement {
48
+ /** The document being edited as provided to editor by [[`Zeroline`]]. */
49
+ @property ( { attribute : false } )
50
+ doc ! : XMLDocument ;
48
51
/** The edited `Element`, a common property of all Substation subeditors. */
49
52
@property ( { attribute : false } )
50
53
element ! : Element ;
@@ -113,7 +116,11 @@ export class SubstationEditor extends LitElement {
113
116
return lNodes . length
114
117
? html `<div class= "container lnode" >
115
118
${ lNodes . map (
116
- lNode => html `<l- node- edito r .element = ${ lNode } > </ l- node- edito r> `
119
+ lNode =>
120
+ html `<l- node- edito r
121
+ .doc = ${ this . doc }
122
+ .element = ${ lNode }
123
+ > </ l- node- edito r> `
117
124
) }
118
125
</ div> `
119
126
: html `` ;
@@ -124,15 +131,22 @@ export class SubstationEditor extends LitElement {
124
131
125
132
const functions = getChildElementsByTagName ( this . element , 'Function' ) ;
126
133
return html ` ${ functions . map (
127
- fUnction => html `<function- edito r .element = ${ fUnction } > </ function- edito r> `
134
+ fUnction =>
135
+ html `<function- edito r
136
+ .doc = ${ this . doc }
137
+ .element = ${ fUnction }
138
+ > </ function- edito r> `
128
139
) } `;
129
140
}
130
141
131
142
renderIedContainer ( ) : TemplateResult {
132
143
const ieds = this . getAttachedIeds ?.( this . element ) ?? [ ] ;
133
144
return ieds ?. length
134
145
? html `<div id= "iedcontainer" >
135
- ${ ieds . map ( ied => html `<ied- edito r .element = ${ ied } > </ ied- edito r> ` ) }
146
+ ${ ieds . map (
147
+ ied =>
148
+ html `<ied- edito r .doc = ${ this . doc } .element = ${ ied } > </ ied- edito r> `
149
+ ) }
136
150
</ div> `
137
151
: html `` ;
138
152
}
@@ -153,6 +167,7 @@ export class SubstationEditor extends LitElement {
153
167
${ pwts . map (
154
168
pwt =>
155
169
html `<powertransfor mer- edito r
170
+ .doc = ${ this . doc }
156
171
.element = ${ pwt }
157
172
?showfunctions= ${ this . showfunctions }
158
173
> </ powertransfor mer- edito r> `
@@ -226,6 +241,7 @@ export class SubstationEditor extends LitElement {
226
241
${ Array . from ( this . element . querySelectorAll ( selectors . VoltageLevel ) ) . map (
227
242
voltageLevel =>
228
243
html `<voltage-level- edito r
244
+ .doc = ${ this . doc }
229
245
.element = ${ voltageLevel }
230
246
.getAttachedIeds = ${ this . getAttachedIeds }
231
247
?readonly = ${ this . readonly }
0 commit comments