@@ -8,11 +8,10 @@ import {
8
8
state ,
9
9
} from 'lit/decorators.js' ;
10
10
11
- import '@material/mwc-button' ;
12
11
import '@material/mwc-dialog' ;
13
- import type { Button } from '@material/mwc-button' ;
14
12
import type { Dialog } from '@material/mwc-dialog' ;
15
13
14
+ import { MdTextButton } from '@scopedelement/material-web/button/MdTextButton.js' ;
16
15
// import '@scopedelement/material-web/icon/icon.js'
17
16
18
17
import '@openscd/oscd-tree-grid' ;
@@ -121,17 +120,17 @@ export class DataSetElementEditor extends LitElement {
121
120
122
121
@queryAll ( 'scl-text-field' ) inputs ! : SclTextField [ ] ;
123
122
124
- @query ( 'mwc-button. save' ) saveButton ! : Button ;
123
+ @query ( '.dataset. save' ) saveButton ! : MdTextButton ;
125
124
126
125
@query ( '.list.fcda' ) fcdaList ! : ActionList ;
127
126
128
- @query ( '#dapickerbutton' ) daPickerButton ! : Button ;
127
+ @query ( '#dapickerbutton' ) daPickerButton ! : MdTextButton ;
129
128
130
129
@query ( '#dapicker' ) daPickerDialog ! : Dialog ;
131
130
132
131
@query ( '#dapicker > oscd-tree-grid' ) daPicker ! : TreeGrid ;
133
132
134
- @query ( '#dopickerbutton' ) doPickerButton ! : Button ;
133
+ @query ( '#dopickerbutton' ) doPickerButton ! : MdTextButton ;
135
134
136
135
@query ( '#dopicker' ) doPickerDialog ! : Dialog ;
137
136
@@ -148,6 +147,8 @@ export class DataSetElementEditor extends LitElement {
148
147
}
149
148
150
149
private onInputChange ( ) : void {
150
+ if ( ! this . element ) return ;
151
+
151
152
this . someDiffOnInputs = Array . from ( this . inputs ?? [ ] ) . some (
152
153
input => this . element ?. getAttribute ( input . label ) !== input . value
153
154
) ;
@@ -291,52 +292,44 @@ export class DataSetElementEditor extends LitElement {
291
292
private renderDataObjectPicker ( ) : TemplateResult {
292
293
const server = this . element ?. closest ( 'Server' ) ! ;
293
294
294
- return html ` <mwc - butto n
295
+ return html ` <md - text - butto n
295
296
id= "doPickerButton"
296
- label = "Add data object"
297
297
icon = "playlist_add"
298
298
?dis abled= ${ ! canAddFCDA ( this . element ! ) }
299
299
@click = ${ ( ) => this . doPickerDialog ?. show ( ) }
300
- > < / mwc - butto n
300
+ > Add data object<md - icon slot = "icon" > playlist_add < / me-icon > < / md - text - butto n
301
301
> <mwc- dialog id= "dopicker" heading = "Add Data Objects" >
302
302
<oscd- tree- grid .tree = ${ dataObjectTree ( server ) } > </ oscd- tree- grid>
303
- <mwc - butto n
303
+ <md - text - butto n
304
304
slot= "secondaryAction"
305
- label = "close"
306
305
@click = ${ ( ) => this . doPickerDialog ?. close ( ) }
307
- > < / mwc - butto n>
308
- <mwc - butto n
306
+ > Close < / md - text - butto n>
307
+ <md - text - butto n
309
308
slot= "primaryAction"
310
- label = "save"
311
- icon = "save"
312
309
@click = ${ this . saveDataObjects }
313
- > < / mwc - butto n>
310
+ > Save <md - icon slot = "icon" > save < / md - icon > < / md - text - butto n>
314
311
</ mwc- dialog> ` ;
315
312
}
316
313
317
314
private renderDataAttributePicker ( ) : TemplateResult {
318
315
const server = this . element ?. closest ( 'Server' ) ! ;
319
316
320
- return html ` <mwc - butto n
317
+ return html ` <md - text - butto n
321
318
id= "daPickerButton"
322
- label = "Add data attribute"
323
319
icon = "playlis t_add"
324
320
?dis abled= ${ ! canAddFCDA ( this . element ! ) }
325
321
@click = ${ ( ) => this . daPickerDialog . show ( ) }
326
- > < / mwc - butto n
322
+ > Add data attribute <md - icon slot = "icon" > playlist_add < / me-icon > < / md - text - butto n
327
323
> <mwc- dialog id= "dapicker" heading = "Add Data Attributes"
328
324
> <oscd- tree- grid .tree = "${ dataAttributeTree ( server ) } "> </ oscd- tree- grid>
329
- <mwc - butto n
325
+ <md - text - butto n
330
326
slot= "secondaryAction"
331
- label = "close"
332
327
@click = ${ ( ) => this . daPickerDialog ?. close ( ) }
333
- > < / mwc - butto n>
334
- <mwc - butto n
328
+ > Close < / md - text - butto n>
329
+ <md - text - butto n
335
330
slot= "primaryAction"
336
- label = "save"
337
- icon = "save"
338
331
@click = ${ this . saveDataAttributes }
339
- > < / mwc - butto n>
332
+ > Save <md - icon slot = "icon" > Save < / md - icon > < / md - text - butto n>
340
333
</ mwc- dialog> ` ;
341
334
}
342
335
@@ -381,13 +374,12 @@ export class DataSetElementEditor extends LitElement {
381
374
@input = ${ ( ) => this . onInputChange ( ) }
382
375
>
383
376
</ scl- text- field>
384
- <mwc- butto n
385
- class= "save"
386
- label = "save"
387
- icon= "save"
377
+ <md- text- butto n
378
+ class= "dataset save"
388
379
?dis abled= ${ ! this . someDiffOnInputs }
389
380
@click = ${ ( ) => this . saveChanges ( ) }
390
- > </ mwc- butto n>
381
+ > Save <md- icon slot= "icon" > save </ md- icon> </ md- text- butto n
382
+ >
391
383
<hr color = "lightgrey" / > ` ;
392
384
}
393
385
0 commit comments