Skip to content

Commit f6bce2e

Browse files
ca-dJakobVogelsang
andauthored
refactor(editor-container): replace with more generic action-pane (#400)
* feat: add action-pane component The new action-pane component is the extraction of the pure user interface part of the old editor-container component, meant to replace the latter while being usable in a more generic way. * refactor: use action-pane in place of editor-container * refactor(zeroline): use action pane (#399) * refactor(zeroline): allow adding child elements to action-pane * style(action-pane): adapt styling * test(action-pane): add unit tests Co-authored-by: Jakob Vogelsang <[email protected]>
1 parent 986db3f commit f6bce2e

15 files changed

+773
-532
lines changed

__snapshots__/action-pane.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# `action-pane`
2+
3+
#### `looks like the latest snapshot`
4+
5+
```html
6+
<section>
7+
<h1>
8+
<span>
9+
<slot name="icon">
10+
</slot>
11+
</span>
12+
<nav>
13+
<slot name="action">
14+
</slot>
15+
</nav>
16+
</h1>
17+
<div>
18+
<slot>
19+
</slot>
20+
</div>
21+
</section>
22+
23+
```
24+
25+
## `with icon property set`
26+
27+
#### `looks like the latest snapshot`
28+
29+
```html
30+
<section>
31+
<h1>
32+
<span>
33+
<slot name="icon">
34+
<mwc-icon>
35+
edit
36+
</mwc-icon>
37+
</slot>
38+
</span>
39+
<nav>
40+
<slot name="action">
41+
</slot>
42+
</nav>
43+
</h1>
44+
<div>
45+
<slot>
46+
</slot>
47+
</div>
48+
</section>
49+
50+
```
51+

__snapshots__/bay-editor.md

Lines changed: 86 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,80 @@
33
#### `looks like the latest snapshot`
44

55
```html
6-
<editor-container
7-
nomargin=""
6+
<action-pane
7+
label="COUPLING_BAY - Bay"
88
tabindex="0"
99
>
1010
<abbr
11-
slot="header"
11+
slot="action"
1212
title="[lnode.tooltip]"
1313
>
1414
<mwc-icon-button icon="account_tree">
1515
</mwc-icon-button>
1616
</abbr>
1717
<abbr
18-
slot="header"
18+
slot="action"
1919
title="[duplicate]"
2020
>
2121
<mwc-icon-button icon="content_copy">
2222
</mwc-icon-button>
2323
</abbr>
2424
<abbr
25-
slot="header"
25+
slot="action"
2626
title="[edit]"
2727
>
2828
<mwc-icon-button icon="edit">
2929
</mwc-icon-button>
3030
</abbr>
3131
<abbr
32-
slot="header"
32+
slot="action"
3333
title="[move]"
3434
>
3535
<mwc-icon-button icon="forward">
3636
</mwc-icon-button>
3737
</abbr>
3838
<abbr
39-
slot="header"
39+
slot="action"
4040
title="[remove]"
4141
>
4242
<mwc-icon-button icon="delete">
4343
</mwc-icon-button>
4444
</abbr>
45+
<abbr
46+
slot="action"
47+
style="position:relative;"
48+
title="[add]"
49+
>
50+
<mwc-icon-button icon="playlist_add">
51+
</mwc-icon-button>
52+
<mwc-menu
53+
corner="BOTTOM_RIGHT"
54+
menucorner="END"
55+
>
56+
<mwc-list-item
57+
aria-disabled="false"
58+
mwc-list-item=""
59+
role="menuitem"
60+
tabindex="0"
61+
value="LNode"
62+
>
63+
<span>
64+
LNode
65+
</span>
66+
</mwc-list-item>
67+
<mwc-list-item
68+
aria-disabled="false"
69+
mwc-list-item=""
70+
role="menuitem"
71+
tabindex="-1"
72+
value="ConductingEquipment"
73+
>
74+
<span>
75+
ConductingEquipment
76+
</span>
77+
</mwc-list-item>
78+
</mwc-menu>
79+
</abbr>
4580
<div id="ceContainer">
4681
<conducting-equipment-editor>
4782
</conducting-equipment-editor>
@@ -54,7 +89,7 @@
5489
<conducting-equipment-editor>
5590
</conducting-equipment-editor>
5691
</div>
57-
</editor-container>
92+
</action-pane>
5893

5994
```
6095

@@ -63,45 +98,80 @@
6398
#### `looks like the latest snapshot`
6499

65100
```html
66-
<editor-container
67-
nomargin=""
101+
<action-pane
102+
label="COUPLING_BAY - Bay"
68103
tabindex="0"
69104
>
70105
<abbr
71-
slot="header"
106+
slot="action"
72107
title="[lnode.tooltip]"
73108
>
74109
<mwc-icon-button icon="account_tree">
75110
</mwc-icon-button>
76111
</abbr>
77112
<abbr
78-
slot="header"
113+
slot="action"
79114
title="[duplicate]"
80115
>
81116
<mwc-icon-button icon="content_copy">
82117
</mwc-icon-button>
83118
</abbr>
84119
<abbr
85-
slot="header"
120+
slot="action"
86121
title="[edit]"
87122
>
88123
<mwc-icon-button icon="edit">
89124
</mwc-icon-button>
90125
</abbr>
91126
<abbr
92-
slot="header"
127+
slot="action"
93128
title="[move]"
94129
>
95130
<mwc-icon-button icon="forward">
96131
</mwc-icon-button>
97132
</abbr>
98133
<abbr
99-
slot="header"
134+
slot="action"
100135
title="[remove]"
101136
>
102137
<mwc-icon-button icon="delete">
103138
</mwc-icon-button>
104139
</abbr>
140+
<abbr
141+
slot="action"
142+
style="position:relative;"
143+
title="[add]"
144+
>
145+
<mwc-icon-button icon="playlist_add">
146+
</mwc-icon-button>
147+
<mwc-menu
148+
corner="BOTTOM_RIGHT"
149+
menucorner="END"
150+
>
151+
<mwc-list-item
152+
aria-disabled="false"
153+
mwc-list-item=""
154+
role="menuitem"
155+
tabindex="0"
156+
value="LNode"
157+
>
158+
<span>
159+
LNode
160+
</span>
161+
</mwc-list-item>
162+
<mwc-list-item
163+
aria-disabled="false"
164+
mwc-list-item=""
165+
role="menuitem"
166+
tabindex="-1"
167+
value="ConductingEquipment"
168+
>
169+
<span>
170+
ConductingEquipment
171+
</span>
172+
</mwc-list-item>
173+
</mwc-menu>
174+
</abbr>
105175
<div id="ceContainer">
106176
<conducting-equipment-editor readonly="">
107177
</conducting-equipment-editor>
@@ -114,7 +184,7 @@
114184
<conducting-equipment-editor readonly="">
115185
</conducting-equipment-editor>
116186
</div>
117-
</editor-container>
187+
</action-pane>
118188

119189
```
120190

0 commit comments

Comments
 (0)