generated from openscd/oscd-save
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfoundation.ts
89 lines (73 loc) · 1.73 KB
/
foundation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { css } from 'lit';
import { identity } from './foundation/identities/identity.js';
import { selector } from './foundation/identities/selector.js';
export function updateElementReference(
newDoc: XMLDocument,
oldElement: Element
): Element | null {
if (!oldElement || !oldElement.closest('SCL')) return null;
const id = identity(oldElement);
const newElement = newDoc.querySelector(selector(oldElement.tagName, id));
return newElement;
}
export const styles = css`
.content {
display: flex;
height: calc(100vh - 184px);
}
.selectionlist {
flex: 35%;
margin: 4px 4px 4px 8px;
background-color: var(--mdc-theme-surface);
overflow-y: scroll;
}
.elementeditorcontainer {
flex: 65%;
margin: 4px 8px 4px 4px;
background-color: var(--mdc-theme-surface);
overflow-y: scroll;
display: flex;
}
.listitem.header {
font-weight: 500;
}
mwc-list-item.hidden[noninteractive] + li[divider] {
display: none;
}
.change.scl.element {
display: none;
}
@media (max-width: 950px) {
.elementeditorcontainer {
display: block;
}
}
@media (max-width: 599px) {
.content {
height: 100%;
}
.selectionlist {
position: absolute;
width: calc(100% - 32px);
height: auto;
top: 110px;
left: 8px;
z-index: 1;
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),
0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
}
.elementeditorcontainer {
display: block;
}
data-set-element-editor {
width: calc(100% - 16px);
}
.selectionlist.hidden {
display: none;
}
.change.scl.element {
display: flex;
margin: 4px 8px 8px;
}
}
`;