| 2 | |
| 3 | export class DropdownField extends Field{ |
| 4 | constructor(args){ |
| 5 | let classes = { |
| 6 | field: ['field', 'field--show-floating-label'], |
| 7 | fieldInput: ['field__input', 'field__input--select'], |
| 8 | fieldInputWrapper: ['field__input-wrapper', 'field__input-wrapper--select'], |
| 9 | arrow: ['field__caret', 'shown-if-js'], |
| 10 | svgIcon: ['icon-svg', 'icon-svg--color-adaptive-lighter','icon-svg--size-10', 'field__caret-svg'], |
| 11 | }; |
| 12 | |
| 13 | super(args); |
| 14 | Object.setPrototypeOf(this, DropdownField.prototype); |
| 15 | Object.assign(this.classes, classes); |
| 16 | |
| 17 | if (typeof args == 'object'){ |
| 18 | this.addField(args); |
| 19 | } |
| 20 | |
| 21 | this.created(); |
| 22 | } |
| 23 | |
| 24 | addField(args){ |
| 25 | if(!args.options) throw new ReferenceError('No options defined for DropdownField'); |