open-consul/ui-v2/lib/block-slots/addon/components/yield-slot.js
John Cowen 6bf6002ab0
ui: Move slots to use attributes over positional params (#7032)
* Change all instances of yield/block-slots to use attributes over positional arguments

* Remove the ability to use yield/block-slots with positional params
2020-01-15 09:15:54 +00:00

23 lines
667 B
JavaScript

import { computed, get } from '@ember/object';
import Component from '@ember/component';
import layout from '../templates/components/yield-slot';
import Slots from '../mixins/slots';
const YieldSlotComponent = Component.extend({
layout,
tagName: '',
_name: computed('name', function() {
return this.name;
}),
_blockParams: computed('params', function() {
return this.params;
}),
_parentView: computed(function() {
return this.nearestOfType(Slots);
}),
isActive: computed('_parentView._slots.[]', '_name', function() {
return get(this, '_parentView._slots').includes(get(this, '_name'));
}),
});
export default YieldSlotComponent;