1
- import { html , TemplateResult } from 'lit-element' ;
2
- import { get , translate } from 'lit-translate' ;
1
+ import { html } from 'lit-element' ;
2
+ import { get } from 'lit-translate' ;
3
3
4
4
import '../../../wizard-textfield.js' ;
5
5
import {
6
- pTypesRedundancyGroup104 , typeDescriptiveNameKeys , typePattern ,
6
+ pTypesRedundancyGroup104
7
7
} from '../foundation/p-types.js' ;
8
8
import {
9
9
cloneElement ,
@@ -20,11 +20,9 @@ import {
20
20
WizardInputElement ,
21
21
WizardMenuActor
22
22
} from '../../../foundation.js' ;
23
- import { ifDefined } from 'lit-html/directives/if-defined' ;
24
- import { typeMaxLength } from '../../../wizards/foundation/p-types.js' ;
25
23
import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation' ;
26
24
import { createLogicLinkWizard , editLogicLinkWizard } from './logiclink.js' ;
27
- import { createCreateTextField } from './foundation.js' ;
25
+ import { createNetworkTextField } from '../foundation /foundation.js' ;
28
26
29
27
export function editRedundancyGroupWizard ( parent : Element , rGNumber : number ) : Wizard {
30
28
const usedLLNumbers = getLogicLinkNumbers ( parent , rGNumber ) ;
@@ -55,7 +53,9 @@ export function editRedundancyGroupWizard(parent: Element, rGNumber: number): Wi
55
53
.maybeValue =${ rGNumber }
56
54
> </ wizard-textfield >
57
55
${ pTypesRedundancyGroup104 . map (
58
- pType => html `${ createEditTextField ( parent , pType , rGNumber ) } `
56
+ pType => html `${ createNetworkTextField ( pType , parent . querySelector (
57
+ `Address > P[type$="RG${ rGNumber } -${ pType } "]`
58
+ ) ?. innerHTML ) } `
59
59
) }
60
60
< h3 > ${ get ( 'protocol104.network.redundancyGroup.wizard.logicLinkGroupTitle' ) } </ h3 >
61
61
< mwc-list
@@ -101,7 +101,7 @@ export function createRedundancyGroupWizard(parent: Element, occupiedRGNumbers:
101
101
value ="${ rGNumber } "
102
102
> </ wizard-textfield >
103
103
${ pTypesRedundancyGroup104 . map (
104
- pType => html `${ createCreateTextField ( pType ) } `
104
+ pType => html `${ createNetworkTextField ( pType ) } `
105
105
) } `
106
106
] ,
107
107
} ,
@@ -233,23 +233,3 @@ function getLogicLinkNumbers(parent: Element, rGNumber: number): number[] {
233
233
234
234
return usedNumbers . sort ( ) ;
235
235
}
236
-
237
- /**
238
- * Create a wizard-textfield element for the Edit wizard.
239
- * @param parent - The parent element of the P to create.
240
- * @param pType - The type of P a Text Field has to be created for.
241
- * @param rGNumber - The Redundancy Group number of the Text Field used in the type.
242
- * @returns - A Text Field created for a specific type for the Edit wizard.
243
- */
244
- function createEditTextField ( parent : Element , pType : string , rGNumber : number ) : TemplateResult {
245
- return html `< wizard-textfield
246
- required
247
- label ="${ pType } "
248
- pattern ="${ ifDefined ( typePattern [ pType ] ) } "
249
- .maybeValue =${ parent . querySelector (
250
- `Address > P[type$="RG${ rGNumber } -${ pType } "]`
251
- ) ?. innerHTML ?? null }
252
- maxLength ="${ ifDefined ( typeMaxLength [ pType ] ) } "
253
- helper="${ translate ( typeDescriptiveNameKeys [ pType ] ) } "
254
- > </ wizard-textfield > `
255
- }
0 commit comments