import ngModule from '../../module'; import Input from '../../lib/input'; import assignProps from '../../lib/assign-props'; import './style.scss'; export default class IconMenu extends Input { constructor($element, $scope, $transclude) { super($element, $scope); this.$transclude = $transclude; this.input = this.element.querySelector('.mdl-button'); } onClick(event) { event.preventDefault(); if (this.onOpen) this.onOpen(); this.showDropDown(); } onDropDownSelect(value) { this.field = value; if (this.onChange) this.onChange({value}); } showDropDown() { assignProps(this, this.$.dropDown, [ 'valueField', 'showField', 'showFilter', 'multiple', '$transclude', 'translateFields', 'model', 'data', 'url', 'fields', 'include', 'where', 'order', 'limit', 'searchFunction' ]); this.$.dropDown.show(this.input); } } IconMenu.$inject = ['$element', '$scope', '$transclude']; ngModule.component('vnIconMenu', { template: require('./icon-menu.html'), bindings: { label: '@', showField: '@?', selection: '