poe-custom-elements
Version:
Path of Exile custom elements
52 lines (51 loc) • 2.12 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { LitElement, html, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import './poe-item-info-content.js';
import './poe-item-info-header.js';
import '../divination-card/poe-divination-card.js';
import { frameKind } from '../../lib/internal.js';
let PoeItemInfoElement = class PoeItemInfoElement extends LitElement {
render() {
if (!this.item) {
return html `<p style="color: red">No Poe Api item data (.item)</p>`;
}
if (frameKind(this.item.frameType) === 'divination') {
return html `<poe-divination-card .name=${this.item.baseType}></poe-divination-card>`;
}
return html `<poe-item-info-header .item=${this.item}></poe-item-info-header>
<poe-item-info-content .item=${this.item}></poe-item-info-content> `;
}
static { this.styles = css `
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
:host {
display: block;
width: fit-content;
min-width: max-content;
}
poe-item-info-content {
padding-inline: 1rem;
}
`; }
};
__decorate([
property({ type: Object }),
__metadata("design:type", Object)
], PoeItemInfoElement.prototype, "item", void 0);
PoeItemInfoElement = __decorate([
customElement('poe-item-info')
], PoeItemInfoElement);
export { PoeItemInfoElement };
//# sourceMappingURL=poe-item-info.js.map