File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -253,4 +253,16 @@ export class InputFieldDeclarationParser {
253253
254254 return InputFieldType . INVALID ;
255255 }
256+
257+ static applyTemplate ( fullDeclaration : InputFieldDeclaration , templateName : string | null | undefined ) {
258+ const template = InputFieldDeclarationParser . templates . filter ( x => x . identifier === templateName ) . first ( ) ?. template ;
259+ if ( template ) {
260+ fullDeclaration . bindTarget = fullDeclaration . bindTarget || template . bindTarget ;
261+ fullDeclaration . isBound = fullDeclaration . isBound || template . isBound ;
262+ fullDeclaration . inputFieldType = fullDeclaration . inputFieldType === InputFieldType . INVALID ? template . inputFieldType : fullDeclaration . inputFieldType || template . inputFieldType ;
263+ fullDeclaration . argumentContainer = template . argumentContainer . mergeByOverride ( fullDeclaration . argumentContainer ) ;
264+ } else {
265+ throw new MetaBindParsingError ( `unknown template name \'${ templateName } \'` ) ;
266+ }
267+ }
256268}
You can’t perform that action at this time.
0 commit comments