2019-08-31 20:51:14 -07:00

53 lines
1.8 KiB
TypeScript

import Component from '@ember/component';
// @ts-ignore: Ignore import of compiled template
import layout from '../templates/components/wherehows-entity-header';
import { tagName, classNames } from '@ember-decorators/component';
import { set } from '@ember/object';
@tagName('section')
@classNames('wherehows-entity-header')
export default class WhereHowsEntityHeader extends Component {
layout = layout;
/**
* References the component name to be used to render the title / name of the entity
* @type {string}
* @memberof WhereHowsEntityHeader
*/
entityTitleComponent!: string;
/**
* References the component name used to render a key-value pair of entity attributes
* @type {string}
* @memberof WhereHowsEntityHeader
*/
entityPropertyComponent!: string;
/**
* References the component name used to render an entity attribute / property that
* deserved prominent placement in the entity header component
* @type {string}
* @memberof WhereHowsEntityHeader
*/
entityAttributePillCalloutComponent!: string;
/**
* References the component name used to render the entity type
* @type {string}
* @memberof WhereHowsEntityHeader
*/
entityTypeComponent!: string;
constructor() {
super(...arguments);
// Initialization defaults for expected component attributes
typeof this.entityTitleComponent === 'string' || set(this, 'entityTitleComponent', 'entity-header/entity-title');
typeof this.entityPropertyComponent === 'string' ||
set(this, 'entityPropertyComponent', 'entity-header/entity-property');
typeof this.entityAttributePillCalloutComponent === 'string' ||
set(this, 'entityAttributePillCalloutComponent', 'entity-header/attribute-callout');
typeof this.entityTypeComponent === 'string' || set(this, 'entityTypeComponent', 'entity-header/entity-type');
}
}