Skip to content

Commit f11121b

Browse files
refactor: get rid of mwc-checkbox and mwc-formfield
1 parent 947e93f commit f11121b

File tree

4 files changed

+32
-131
lines changed

4 files changed

+32
-131
lines changed

editors/gsecontrol/gse-control-element-editor.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import {
99
} from 'lit/decorators.js';
1010

1111
import '@material/mwc-button';
12-
import '@material/mwc-formfield';
13-
import '@material/mwc-checkbox';
1412
import type { Button } from '@material/mwc-button';
15-
import type { Checkbox } from '@material/mwc-checkbox';
13+
14+
// import '@scopedelement/material-web/checkbox/checkbox.js'
15+
import type { MdCheckbox } from '@scopedelement/material-web/checkbox/MdCheckbox.js';
1616

1717
import { newEditEvent } from '@openenergytools/open-scd-core';
1818
import {
@@ -93,7 +93,7 @@ export class GseControlElementEditor extends LitElement {
9393

9494
@query('.content.gsecontrol > .save') gseControlSave!: Button;
9595

96-
@query('#instType') instType?: Checkbox;
96+
@query('#instType') instType?: MdCheckbox;
9797

9898
public resetInputs(type: 'GSEControl' | 'GSE' = 'GSEControl'): void {
9999
this.element = null; // removes inputs and forces a re-render
@@ -230,13 +230,15 @@ export class GseControlElementEditor extends LitElement {
230230

231231
return html`<div class="content gse">
232232
<h3>Communication Settings (GSE)</h3>
233-
<mwc-formfield label="Add XMLSchema-instance type"
234-
><mwc-checkbox
233+
<form>
234+
<md-checkbox
235235
id="instType"
236236
?checked="${hasInstType}"
237237
@change=${this.onGSEInputChange}
238-
></mwc-checkbox></mwc-formfield
239-
>${Object.entries(attributes).map(
238+
></md-checkbox>
239+
<label class="insttype label">Add XMLSchema-instance type</label>
240+
</form>
241+
${Object.entries(attributes).map(
240242
([key, value]) =>
241243
html`<scl-text-field
242244
label="${key}"
@@ -427,6 +429,12 @@ export class GseControlElementEditor extends LitElement {
427429
text-overflow: ellipsis;
428430
}
429431
432+
.insttype.label {
433+
margin-left: 10px;
434+
font-weight: 300;
435+
color: var(--oscd-theme-base00);
436+
}
437+
430438
*[iconTrailing='search'] {
431439
--mdc-shape-small: 28px;
432440
}

editors/sampledvalue/sampled-value-control-element-editor.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import {
1717
} from '@openenergytools/scl-lib';
1818

1919
import '@material/mwc-button';
20-
import '@material/mwc-checkbox';
21-
import '@material/mwc-formfield';
2220
import type { Button } from '@material/mwc-button';
23-
import type { Checkbox } from '@material/mwc-checkbox';
21+
22+
// import '@scopedelement/material-web/checkbox/checkbox.js'
23+
import type { MdCheckbox } from '@scopedelement/material-web/checkbox/MdCheckbox.js';
2424

2525
import '@openenergytools/scl-checkbox';
2626
import '@openenergytools/scl-select';
@@ -113,7 +113,7 @@ export class SampledValueControlElementEditor extends LitElement {
113113

114114
@query('.smvopts.save') smvOptsSave!: Button;
115115

116-
@query('.smv.insttype') instType?: Checkbox;
116+
@query('.smv.insttype') instType?: MdCheckbox;
117117

118118
public resetInputs(
119119
type: 'SampledValueControl' | 'SMV' = 'SampledValueControl'
@@ -274,13 +274,15 @@ export class SampledValueControlElementEditor extends LitElement {
274274

275275
return html` <div class="content smv">
276276
<h3>Communication Settings (SMV)</h3>
277-
<mwc-formfield label="Add XMLSchema-instance type"
278-
><mwc-checkbox
277+
<form>
278+
<md-checkbox
279279
class="smv insttype"
280280
?checked="${hasInstType}"
281281
@change=${this.onSMVInputChange}
282-
></mwc-checkbox></mwc-formfield
283-
>${Object.entries(attributes).map(
282+
></md-checkbox>
283+
<label class="insttype label">Add XMLSchema-instance type</label>
284+
</form>
285+
${Object.entries(attributes).map(
284286
([key, value]) =>
285287
html`<scl-text-field
286288
class="smv attribute"
@@ -537,6 +539,12 @@ export class SampledValueControlElementEditor extends LitElement {
537539
text-overflow: ellipsis;
538540
}
539541
542+
.insttype.label {
543+
margin-left: 10px;
544+
font-weight: 300;
545+
color: var(--oscd-theme-base00);
546+
}
547+
540548
*[iconTrailing='search'] {
541549
--mdc-shape-small: 28px;
542550
}

package-lock.json

-113
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@material/mwc-button": "^0.27.0",
30-
"@material/mwc-checkbox": "^0.27.0",
3130
"@material/mwc-dialog": "^0.27.0",
32-
"@material/mwc-formfield": "^0.27.0",
3331
"@material/mwc-icon": "^0.27.0",
3432
"@material/mwc-icon-button": "^0.27.0",
3533
"@material/mwc-list": "^0.27.0",

0 commit comments

Comments
 (0)