2019-08-31 20:51:14 -07:00
|
|
|
import Component from '@ember/component';
|
|
|
|
// @ts-ignore: Ignore import of compiled template
|
2020-08-26 15:44:50 -07:00
|
|
|
import layout from '../../templates/components/entity-page/wherehows-entity-header';
|
2019-08-31 20:51:14 -07:00
|
|
|
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;
|
|
|
|
|
2020-08-26 15:44:50 -07:00
|
|
|
constructor(properties?: object) {
|
|
|
|
super(properties);
|
2019-08-31 20:51:14 -07:00
|
|
|
|
|
|
|
// Initialization defaults for expected component attributes
|
2020-08-26 15:44:50 -07:00
|
|
|
typeof this.entityTitleComponent === 'string' ||
|
|
|
|
set(this, 'entityTitleComponent', 'entity-page/entity-header/entity-title');
|
2019-08-31 20:51:14 -07:00
|
|
|
typeof this.entityPropertyComponent === 'string' ||
|
2020-08-26 15:44:50 -07:00
|
|
|
set(this, 'entityPropertyComponent', 'entity-page/entity-header/entity-property');
|
2019-08-31 20:51:14 -07:00
|
|
|
typeof this.entityAttributePillCalloutComponent === 'string' ||
|
2020-08-26 15:44:50 -07:00
|
|
|
set(this, 'entityAttributePillCalloutComponent', 'entity-page/entity-header/attribute-callout');
|
|
|
|
typeof this.entityTypeComponent === 'string' ||
|
|
|
|
set(this, 'entityTypeComponent', 'entity-page/entity-header/entity-type');
|
2019-08-31 20:51:14 -07:00
|
|
|
}
|
|
|
|
}
|