Skip to content

Commit b651674

Browse files
authored
Merge pull request #52 from com-pas/chore/plugins-rendering-issues
chore: Plugins rendering issues
2 parents 4311e6d + d648035 commit b651674

18 files changed

Lines changed: 312 additions & 85 deletions

packages/distribution/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"./dist/**"
2121
],
2222
"dependencies": {
23-
"@compas-oscd/open-scd": "^0.34.44",
24-
"@compas-oscd/plugins": "0.0.4"
23+
"@compas-oscd/open-scd": "0.34.48",
24+
"@compas-oscd/plugins": "0.0.5"
2525
},
2626
"scripts": {
2727
"clean": "rimraf build",

packages/openscd/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compas-oscd/open-scd",
3-
"version": "0.34.47",
3+
"version": "0.34.48",
44
"repository": "https://github.com/openscd/open-scd.git",
55
"directory": "packages/openscd",
66
"description": "A bottom-up substation configuration designer for projects described using SCL `IEC 61850-6` Edition 2 or greater.",
@@ -57,6 +57,7 @@
5757
"./dist/foundation/scl.js": "./dist/foundation/scl.js",
5858
"./dist/icons/icons.js": "./dist/icons/icons.js",
5959
"./dist/icons/ied-icons.js": "./dist/icons/ied-icons.js",
60+
"./dist/icons/icons.components.js": "./dist/icons/icons.components.js",
6061
"./dist/icons/lnode.js": "./dist/icons/lnode.js"
6162
},
6263
"dependencies": {

packages/openscd/src/foundation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { LitElement, TemplateResult, html } from 'lit-element';
22
import { directive, Part } from 'lit-html';
3+
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
34

45
import { List } from '@material/mwc-list';
56
import { Select } from '@material/mwc-select';
@@ -15,6 +16,7 @@ import { WizardCheckbox } from './wizard-checkbox.js';
1516
import { EditorAction } from '@compas-oscd/core';
1617

1718
export const oscdHtml = html;
19+
export const oscdUnsafeHTML = unsafeHTML;
1820

1921
export const wizardInputSelector =
2022
'wizard-textfield, mwc-textfield, ace-editor, mwc-select, wizard-select, wizard-checkbox';
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
import {
2+
customElement,
3+
html,
4+
LitElement,
5+
} from 'lit-element';
6+
7+
import {
8+
bayIcon,
9+
circuitBreakerIcon,
10+
currentTransformerIcon,
11+
disconnectorIcon,
12+
earthSwitchIcon,
13+
generalConductingEquipmentIcon,
14+
gooseIcon,
15+
lineIcon,
16+
processIcon,
17+
smvIcon,
18+
substationIcon,
19+
voltageLevelIcon,
20+
voltageTransformerIcon
21+
} from './icons.js';
22+
import {
23+
automationLogicalNode,
24+
controlLogicalNode,
25+
functionalLogicalNode,
26+
furtherPowerSystemEquipmentLogicalNode,
27+
generalLogicalNode,
28+
interfacingLogicalNode,
29+
measurementLogicalNode,
30+
nonElectricalLogicalNode,
31+
powerTransformerLogicalNode,
32+
protectionLogicalNode,
33+
protectionRelatedLogicalNode,
34+
qualityLogicalNode,
35+
supervisionLogicalNode,
36+
switchgearLogicalNode,
37+
systemLogicalNode,
38+
transformerLogicalNode,
39+
} from './lnode.js';
40+
41+
@customElement('custom-icon-bay')
42+
export class CustomIconBay extends LitElement {
43+
render() {
44+
return html`${bayIcon}`;
45+
}
46+
}
47+
48+
@customElement('custom-icon-substation')
49+
export class CustomIconSubstation extends LitElement {
50+
render() {
51+
return html`${substationIcon}`;
52+
}
53+
}
54+
55+
@customElement('custom-icon-voltagelevel')
56+
export class CustomIconVoltageLevel extends LitElement {
57+
render() {
58+
return html`${voltageLevelIcon}`;
59+
}
60+
}
61+
62+
@customElement('custom-icon-circuitbreaker')
63+
export class CustomIconCircuitBreaker extends LitElement {
64+
render() {
65+
return html`${circuitBreakerIcon}`;
66+
}
67+
}
68+
69+
@customElement('custom-icon-disconnector')
70+
export class CustomIconDisconnector extends LitElement {
71+
render() {
72+
return html`${disconnectorIcon}`;
73+
}
74+
}
75+
76+
@customElement('custom-icon-currenttransformer')
77+
export class CustomIconCurrentTransformer extends LitElement {
78+
render() {
79+
return html`${currentTransformerIcon}`;
80+
}
81+
}
82+
83+
@customElement('custom-icon-voltagetransformer')
84+
export class CustomIconVoltageTransformer extends LitElement {
85+
render() {
86+
return html`${voltageTransformerIcon}`;
87+
}
88+
}
89+
90+
@customElement('custom-icon-earthswitch')
91+
export class CustomIconEarthSwitch extends LitElement {
92+
render() {
93+
return html`${earthSwitchIcon}`;
94+
}
95+
}
96+
97+
@customElement('custom-icon-generalconductingequipment')
98+
export class CustomIconGeneralConductingEquipment extends LitElement {
99+
render() {
100+
return html`${generalConductingEquipmentIcon}`;
101+
}
102+
}
103+
104+
@customElement('custom-icon-goose')
105+
export class CustomIconGoose extends LitElement {
106+
render() {
107+
return html`${gooseIcon}`;
108+
}
109+
}
110+
111+
@customElement('custom-icon-smv')
112+
export class CustomIconSmv extends LitElement {
113+
render() {
114+
return html`${smvIcon}`;
115+
}
116+
}
117+
118+
@customElement('custom-icon-line')
119+
export class CustomIconLine extends LitElement {
120+
render() {
121+
return html`${lineIcon}`;
122+
}
123+
}
124+
125+
@customElement('custom-icon-process')
126+
export class CustomIconProcess extends LitElement {
127+
render() {
128+
return html`${processIcon}`;
129+
}
130+
}
131+
132+
@customElement('custom-icon-lnode-automation')
133+
export class CustomIconLNodeAutomation extends LitElement {
134+
render() {
135+
return html`${automationLogicalNode}`;
136+
}
137+
}
138+
139+
@customElement('custom-icon-lnode-control')
140+
export class CustomIconLNodeControl extends LitElement {
141+
render() {
142+
return html`${controlLogicalNode}`;
143+
}
144+
}
145+
146+
@customElement('custom-icon-lnode-functional')
147+
export class CustomIconLNodeFunctional extends LitElement {
148+
render() {
149+
return html`${functionalLogicalNode}`;
150+
}
151+
}
152+
153+
@customElement('custom-icon-lnode-furtherpowersystemequipment')
154+
export class CustomIconLNodeFurtherPowerSystemEquipment extends LitElement {
155+
render() {
156+
return html`${furtherPowerSystemEquipmentLogicalNode}`;
157+
}
158+
}
159+
160+
@customElement('custom-icon-lnode-general')
161+
export class CustomIconLNodeGeneral extends LitElement {
162+
render() {
163+
return html`${generalLogicalNode}`;
164+
}
165+
}
166+
167+
@customElement('custom-icon-lnode-interfacing')
168+
export class CustomIconLNodeInterfacing extends LitElement {
169+
render() {
170+
return html`${interfacingLogicalNode}`;
171+
}
172+
}
173+
174+
@customElement('custom-icon-lnode-measurement')
175+
export class CustomIconLNodeMeasurement extends LitElement {
176+
render() {
177+
return html`${measurementLogicalNode}`;
178+
}
179+
}
180+
181+
@customElement('custom-icon-lnode-nonelectrical')
182+
export class CustomIconLNodeNonElectrical extends LitElement {
183+
render() {
184+
return html`${nonElectricalLogicalNode}`;
185+
}
186+
}
187+
188+
@customElement('custom-icon-lnode-powertransformer')
189+
export class CustomIconLNodePowerTransformer extends LitElement {
190+
render() {
191+
return html`${powerTransformerLogicalNode}`;
192+
}
193+
}
194+
195+
@customElement('custom-icon-lnode-protection')
196+
export class CustomIconLNodeProtection extends LitElement {
197+
render() {
198+
return html`${protectionLogicalNode}`;
199+
}
200+
}
201+
202+
@customElement('custom-icon-lnode-protectionrelated')
203+
export class CustomIconLNodeProtectionRelated extends LitElement {
204+
render() {
205+
return html`${protectionRelatedLogicalNode}`;
206+
}
207+
}
208+
209+
@customElement('custom-icon-lnode-quality')
210+
export class CustomIconLNodeQuality extends LitElement {
211+
render() {
212+
return html`${qualityLogicalNode}`;
213+
}
214+
}
215+
216+
@customElement('custom-icon-lnode-supervision')
217+
export class CustomIconLNodeSupervision extends LitElement {
218+
render() {
219+
return html`${supervisionLogicalNode}`;
220+
}
221+
}
222+
223+
@customElement('custom-icon-lnode-switchgear')
224+
export class CustomIconLNodeSwitchgear extends LitElement {
225+
render() {
226+
return html`${switchgearLogicalNode}`;
227+
}
228+
}
229+
230+
@customElement('custom-icon-lnode-system')
231+
export class CustomIconLNodeSystem extends LitElement {
232+
render() {
233+
return html`${systemLogicalNode}`;
234+
}
235+
}
236+
237+
@customElement('custom-icon-lnode-transformer')
238+
export class CustomIconLNodeTransformer extends LitElement {
239+
render() {
240+
return html`${transformerLogicalNode}`;
241+
}
242+
}

packages/plugins/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compas-oscd/plugins",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"repository": "https://github.com/com-pas/open-scd.git",
55
"directory": "packages/plugins",
66
"description": "The official plug-ins of open-scd.",
@@ -33,7 +33,7 @@
3333
"@material/mwc-textfield": "0.22.1",
3434
"@compas-oscd/core": "^0.1.23",
3535
"@compas-oscd/xml": "^0.0.1",
36-
"@compas-oscd/open-scd": "0.34.47",
36+
"@compas-oscd/open-scd": "0.34.48",
3737
"@omicronenergy/oscd-ui": "0.0.11",
3838
"@openenergytools/scl-lib": "^1.8.0",
3939
"lit": "^2.2.7",

packages/plugins/src/editors/subscription/fcda-binding-list.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
identity,
3131
newWizardEvent,
3232
} from '@compas-oscd/open-scd/dist/foundation.js';
33-
import { gooseIcon, smvIcon } from '@compas-oscd/open-scd/dist/icons/icons.js';
33+
import '@compas-oscd/open-scd/dist/icons/icons.components.js';
3434
import { wizards } from '../../wizards/wizard-library.js';
3535

3636
import {
@@ -82,7 +82,7 @@ export class FcdaBindingList extends LitElement {
8282
`fcda-binding-list-${
8383
this.includeLaterBinding ? 'later-binding' : 'data-binding'
8484
}-${this.controlTag}$hideSubscribed`
85-
) === 'true' ?? false
85+
) === 'true'
8686
);
8787
}
8888

@@ -109,7 +109,7 @@ export class FcdaBindingList extends LitElement {
109109
`fcda-binding-list-${
110110
this.includeLaterBinding ? 'later-binding' : 'data-binding'
111111
}-${this.controlTag}$hideNotSubscribed`
112-
) === 'true' ?? false
112+
) === 'true'
113113
);
114114
}
115115

@@ -129,8 +129,8 @@ export class FcdaBindingList extends LitElement {
129129
@query('.control-block-list') controlBlockList!: List;
130130

131131
private iconControlLookup: iconLookup = {
132-
SampledValueControl: smvIcon,
133-
GSEControl: gooseIcon,
132+
SampledValueControl: html`<custom-icon-smv></custom-icon-smv>`,
133+
GSEControl: html`<custom-icon-goose></custom-icon-goose>`,
134134
};
135135

136136
constructor() {

packages/plugins/src/editors/subscription/goose/goose-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
newWizardEvent,
2020
} from '@compas-oscd/open-scd/dist/foundation.js';
2121
import { newGOOSESelectEvent } from './foundation.js';
22-
import { gooseIcon } from '@compas-oscd/open-scd/dist/icons/icons.js';
22+
import '@compas-oscd/open-scd/dist/icons/icons.components.js';
2323
import { wizards } from '../../../wizards/wizard-library.js';
2424
import { getOrderedIeds, styles } from '../foundation.js';
2525

@@ -65,7 +65,7 @@ export class GooseList extends LitElement {
6565
hasMeta
6666
value="${identity(gseControl)}"
6767
>
68-
<mwc-icon slot="graphic">${gooseIcon}</mwc-icon>
68+
<mwc-icon slot="graphic"><custom-icon-goose></custom-icon-goose></mwc-icon>
6969
<span>${gseControl.getAttribute('name')}</span>
7070
<mwc-icon-button
7171
class="${classMap({

packages/plugins/src/editors/subscription/sampledvalues/smv-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
newWizardEvent,
1919
} from '@compas-oscd/open-scd/dist/foundation.js';
2020
import { newSmvSelectEvent } from './foundation.js';
21-
import { smvIcon } from '@compas-oscd/open-scd/dist/icons/icons.js';
21+
import '@compas-oscd/open-scd/dist/icons/icons.components.js';
2222
import { getOrderedIeds, styles } from '../foundation.js';
2323
import { classMap } from 'lit-html/directives/class-map.js';
2424
import { wizards } from '../../../wizards/wizard-library.js';
@@ -77,7 +77,7 @@ export class SmvPublisherList extends LitElement {
7777
hasMeta
7878
value="${identity(smvControl)}"
7979
>
80-
<mwc-icon slot="graphic">${smvIcon}</mwc-icon>
80+
<mwc-icon slot="graphic"><custom-icon-smv></custom-icon-smv></mwc-icon>
8181
<span>${smvControl.getAttribute('name')}</span>
8282
<mwc-icon-button
8383
class="${classMap({

packages/plugins/src/editors/substation/bay-editor.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ import {
3535
} from '@compas-oscd/xml';
3636

3737
import { newActionEvent } from '@compas-oscd/core';
38-
import {
39-
bayIcon,
40-
voltageLevelIcon,
41-
} from '@compas-oscd/open-scd/dist/icons/icons.js';
38+
39+
import '@compas-oscd/open-scd/dist/icons/icons.components.js';
4240
import { emptyWizard, wizards } from '../../wizards/wizard-library.js';
4341
import {
4442
cloneSubstationElement,
@@ -194,7 +192,7 @@ export class BayEditor extends LitElement {
194192
render(): TemplateResult {
195193
return html`${this.renderRedirectUI()}<action-pane label="${this.header}">
196194
<mwc-icon class="substation-editor-icon" slot="icon"
197-
>${bayIcon}</mwc-icon
195+
> <custom-icon-bay></custom-icon-bay> </mwc-icon
198196
>
199197
<abbr slot="action" title="${get('lnode.tooltip')}">
200198
<mwc-icon-button

0 commit comments

Comments
 (0)