[TLC-254] Add getTypeBindRelations helper method to bind service

This commit is contained in:
Kim Shepherd
2022-04-23 16:05:20 +12:00
parent 7fd7eb31cb
commit d3a78b8ad5

View File

@@ -11,7 +11,7 @@ import {
DynamicFormControlMatcher, DynamicFormControlMatcher,
DynamicFormControlModel, DynamicFormControlModel,
DynamicFormControlRelation, DynamicFormControlRelation,
DynamicFormRelationService, DynamicFormRelationService, MATCH_VISIBLE,
OR_OPERATOR OR_OPERATOR
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
@@ -217,4 +217,20 @@ export class DsDynamicTypeBindRelationService {
return subscriptions; return subscriptions;
} }
public getTypeBindRelations(configuredTypeBindValues: string[]): DynamicFormControlRelation[] {
const bindValues = [];
configuredTypeBindValues.forEach((value) => {
bindValues.push({
id: 'dc.type',
value: value
});
});
return [{
match: MATCH_VISIBLE,
operator: OR_OPERATOR,
when: bindValues
}];
}
} }