| 14 | } |
| 15 | |
| 16 | addField(args){ |
| 17 | let input = document.createElement('input'); |
| 18 | input.classList.add(...this.classes.fieldInput); |
| 19 | input.placeholder = (args.placeholder) ? args.placeholder : ''; |
| 20 | input.size = (args.size) ? args.size : 30; |
| 21 | input.type = (args.type) ? args.type : 'text'; |
| 22 | input.value = (args.defaultValue) ? args.defaultValue : ''; |
| 23 | |
| 24 | input.name = this.fieldName; |
| 25 | input.id = this.fieldId; |
| 26 | |
| 27 | this.querySelector(this.selectors.wrapper).appendChild(input); |
| 28 | |
| 29 | if(typeof args.tooltip == 'string'){ |
| 30 | this.addTooltip(args.tooltip); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | addTooltip(text = '', icon = '#question'){ |
| 35 | this.removeTooltip(); |