1
- import { get } from "lit-translate" ;
2
- import {
3
- css ,
4
- customElement ,
5
- html ,
6
- LitElement ,
7
- property ,
8
- TemplateResult
9
- } from "lit-element" ;
1
+ import { get } from 'lit-translate' ;
2
+ import { css , customElement , html , TemplateResult } from 'lit-element' ;
10
3
11
4
import './subnetwork-container.js' ;
12
5
import {
13
6
compareNames ,
14
7
createElement ,
15
8
newActionEvent ,
16
- newWizardEvent
17
- } from "../../foundation.js" ;
18
- import { createSubNetworkWizard } from "./wizards/subnetwork.js" ;
9
+ newWizardEvent ,
10
+ } from '../../foundation.js' ;
11
+ import { createSubNetworkWizard } from './wizards/subnetwork.js' ;
12
+ import { Base104Container } from './base-container.js' ;
19
13
20
14
@customElement ( 'network-104-container' )
21
- export class Network104Container extends LitElement {
22
- @property ( )
23
- doc ! : XMLDocument ;
24
-
15
+ export class Network104Container extends Base104Container {
25
16
private getSubNetworkElements ( ) : Element [ ] {
26
- return Array . from ( this . doc . querySelectorAll ( 'Communication > SubNetwork' ) ?? [ ] )
17
+ return Array . from (
18
+ this . doc . querySelectorAll ( 'Communication > SubNetwork' ) ?? [ ]
19
+ )
27
20
. filter ( network => network . getAttribute ( 'type' ) === '104' )
28
- . sort ( ( a , b ) => compareNames ( a , b ) ) ;
21
+ . sort ( ( a , b ) => compareNames ( a , b ) ) ;
29
22
}
30
23
31
24
/** Opens a [[`WizardDialog`]] for creating a new `SubNetwork` element. */
@@ -46,27 +39,27 @@ export class Network104Container extends LitElement {
46
39
47
40
render ( ) : TemplateResult {
48
41
return html `<mwc- fab
49
- extended
50
- icon= "add"
51
- label = "${ get ( 'subnetwork.wizard.title.add' ) } "
52
- @click = ${ ( ) => this . openCreateSubNetworkWizard ( ) }
53
- > </ mwc- fab>
54
- <section>
55
- ${ this . getSubNetworkElements ( )
56
- . map (
42
+ extended
43
+ icon= "add"
44
+ label = "${ get ( 'subnetwork.wizard.title.add' ) } "
45
+ @click = ${ ( ) => this . openCreateSubNetworkWizard ( ) }
46
+ > </ mwc- fab>
47
+ <section>
48
+ ${ this . getSubNetworkElements ( ) . map (
57
49
subnetwork =>
58
50
html `<subnetwor k-104- container
59
- .element = ${ subnetwork }
60
- > </ subnetwor k-104- container> `
51
+ .doc = "${ this . doc } "
52
+ .element = ${ subnetwork }
53
+ > </ subnetwor k-104- container> `
61
54
) }
62
- </ section> ` ;
55
+ </ section> ` ;
63
56
}
64
57
65
58
static styles = css `
66
59
: host {
67
60
width : 100vw ;
68
61
}
69
-
62
+
70
63
mwc-fab {
71
64
position : fixed;
72
65
bottom : 32px ;
0 commit comments