33 * @typedef {import('./dspf.d.ts').RecordInfo } RecordInfo
44 * @typedef {import('./dspf.d.ts').FieldInfo } FieldInfo
55 * @typedef {import('./dspf.d.ts').Keyword } Keyword
6+ * @typedef {import('./dspf.d.ts').Conditional } Conditional
67 * @typedef {import("konva").default.Rect } Rect
78 * @typedef {import("konva").default.Stage } Stage
89 * @typedef {import("konva").default.Group } Group
@@ -261,13 +262,13 @@ function renderSelectedFormat(layer, format) {
261262 windowTitle . keywords . push ( {
262263 name : `COLOR` ,
263264 value : parts [ index + 1 ] ,
264- conditions : [ ]
265+ conditional : new Conditional ( )
265266 } ) ;
266267 case `*DSPATR` :
267268 windowTitle . keywords . push ( {
268269 name : `DSPATR` ,
269270 value : parts [ index + 1 ] ,
270- conditions : [ ]
271+ conditional : new Conditional ( )
271272 } ) ;
272273 break ;
273274
@@ -289,7 +290,7 @@ function renderSelectedFormat(layer, format) {
289290 windowTitle . keywords . push ( {
290291 name : `COLOR` ,
291292 value : `BLU` ,
292- conditions : [ ]
293+ conditional : new Conditional ( )
293294 } ) ;
294295 }
295296
@@ -409,12 +410,12 @@ function addFieldsToLayer(layer, format) {
409410 fields . forEach ( field => {
410411 let canDisplay = true ;
411412
412- field . conditions . forEach ( cond => {
413- // TODO: indicator support?
413+ // TODO: indicator support?
414+ //field.conditions.forEach(cond => {
414415 // if (this.indicators[cond.indicator] !== (cond.negate ? false : true)) {
415416 // canDisplay = false;
416417 // }
417- } ) ;
418+ // });
418419
419420 if ( canDisplay ) {
420421 const content = getElement ( field ) ;
@@ -1028,11 +1029,12 @@ function createKeywordPanel(id, inputKeywords, onUpdate) {
10281029 value : keyword ,
10291030 description : keyword . value ,
10301031 actions,
1031- subItems : keyword . conditions . map ( c => ( {
1032- label : String ( c . indicator ) ,
1033- description : c . negate ? `Negated` : undefined ,
1032+ // TODO: Support multiple conditions (or-groups)
1033+ subItems : keyword . conditional . conditions [ 0 ] . indicators . map ( ind => ( {
1034+ label : String ( ind . indicator ) ,
1035+ description : ind . negate ? `Negated` : undefined ,
10341036 icons
1035- } ) ) ,
1037+ } ) )
10361038 } ;
10371039 } ) ;
10381040 } ;
@@ -1294,7 +1296,7 @@ function editKeyword(onUpdate, keyword) {
12941296 const newKeyword = {
12951297 name : keywordName ,
12961298 value : keywordValue ? keywordValue : undefined ,
1297- conditions : [ ]
1299+ conditional : new Conditional ( )
12981300 } ;
12991301
13001302 if ( ind1 !== `None` ) {
0 commit comments