2018-09-04 09:49:00 +00:00
|
|
|
import ngModule from '../../module';
|
2019-10-18 19:36:30 +00:00
|
|
|
import Component from '../../lib/component';
|
2018-09-04 09:49:00 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2019-10-18 19:36:30 +00:00
|
|
|
export default class Chip extends Component {
|
2021-06-17 13:09:04 +00:00
|
|
|
onRemove($event) {
|
|
|
|
if (!this.disabled) this.emit('remove', {$event});
|
2018-09-04 09:49:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Chip.$inject = ['$element', '$scope', '$transclude'];
|
|
|
|
|
2019-10-28 16:31:33 +00:00
|
|
|
ngModule.vnComponent('vnChip', {
|
2018-09-04 09:49:00 +00:00
|
|
|
template: require('./index.html'),
|
2021-06-17 13:09:04 +00:00
|
|
|
transclude: {
|
|
|
|
prepend: '?prepend',
|
|
|
|
append: '?append'
|
|
|
|
},
|
2018-09-04 09:49:00 +00:00
|
|
|
controller: Chip,
|
|
|
|
bindings: {
|
2018-09-07 10:20:57 +00:00
|
|
|
disabled: '<?',
|
2019-10-18 19:36:30 +00:00
|
|
|
removable: '<?'
|
2018-09-04 09:49:00 +00:00
|
|
|
}
|
|
|
|
});
|