@@ -2,8 +2,7 @@ import { MarkdownRenderChild, TFile } from 'obsidian';
22import MetaBindPlugin from './main' ;
33import { AbstractInputField } from './inputFields/AbstractInputField' ;
44import { InputFieldFactory } from './inputFields/InputFieldFactory' ;
5- import { InputFieldArgumentType , InputFieldDeclaration , InputFieldDeclarationParser } from './parsers/InputFieldDeclarationParser' ;
6- import { isFalsy , isTruthy , MetaBindBindTargetError , MetaBindInternalError } from './utils/Utils' ;
5+ import { InputFieldArgumentType , InputFieldDeclaration } from './parsers/InputFieldDeclarationParser' ;
76import { AbstractInputFieldArgument } from './inputFieldArguments/AbstractInputFieldArgument' ;
87import { ClassInputFieldArgument } from './inputFieldArguments/ClassInputFieldArgument' ;
98import { parsePath , traverseObjectByPath } from '@opd-libs/opd-metadata-lib/lib/Utils' ;
@@ -33,7 +32,15 @@ export class InputFieldMarkdownRenderChild extends MarkdownRenderChild {
3332 metadataValueUpdateQueue : any [ ] ;
3433 inputFieldValueUpdateQueue : any [ ] ;
3534
36- constructor ( containerEl : HTMLElement , type : InputFieldMarkdownRenderChildType , fullDeclaration : string , plugin : MetaBindPlugin , filePath : string , uuid : string , error ?: string ) {
35+ constructor (
36+ containerEl : HTMLElement ,
37+ type : InputFieldMarkdownRenderChildType ,
38+ declaration : InputFieldDeclaration ,
39+ plugin : MetaBindPlugin ,
40+ filePath : string ,
41+ uuid : string ,
42+ error ?: string
43+ ) {
3744 super ( containerEl ) ;
3845
3946 this . error = error || '' ;
@@ -48,24 +55,20 @@ export class InputFieldMarkdownRenderChild extends MarkdownRenderChild {
4855 this . intervalCounter = 0 ;
4956 this . inputFieldDeclaration = declaration ;
5057
51- this . uid = this . plugin . markDownInputFieldIndex ;
52- this . plugin . markDownInputFieldIndex += 1 ;
53-
5458 if ( ! error ) {
55- try {
56- if ( this . inputFieldDeclaration . isBound ) {
57- this . parseBindTarget ( ) ;
58- }
59-
60-
61- this . inputField = InputFieldFactory . createInputField ( this . inputFieldDeclaration . inputFieldType , {
62- type : type ,
63- inputFieldMarkdownRenderChild : this ,
64- onValueChanged : this . updateMetadataManager . bind ( this ) ,
65- } ) ;
66- } catch ( e : any ) {
67- this . error = e . message ;
68- console . warn ( e ) ;
59+ try {
60+ if ( this . inputFieldDeclaration . isBound ) {
61+ this . parseBindTarget ( ) ;
62+ }
63+
64+ this . inputField = InputFieldFactory . createInputField ( this . inputFieldDeclaration . inputFieldType , {
65+ type : type ,
66+ inputFieldMarkdownRenderChild : this ,
67+ onValueChanged : this . updateMetadataManager . bind ( this ) ,
68+ } ) ;
69+ } catch ( e : any ) {
70+ this . error = e . message ;
71+ console . warn ( e ) ;
6972 }
7073 }
7174 }
0 commit comments