poe-custom-elements
Version:
Path of Exile custom elements
78 lines (77 loc) • 2.85 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.js';
import { basePath } from '../lib/base_path.js';
import { cardElementData } from './divination-card/data.js';
/**
* Itemized divination card with divination card element on hover, that requires only a name of card.
* @summary Itemized divination card with divination card element on hover,
* that requires only a name of card.
*
* @cssprop --poe-item-size - Size of item.
* @cssprop --stack-size-font-size - Font size of stack size.
*
* Copy item-card and divination-card folders to your public dir.
*/
let PoeItemCardElement = class PoeItemCardElement extends LitElement {
constructor() {
super(...arguments);
this.name = 'Rain of Chaos';
}
render() {
return html `<poe-item
.item=${{
baseType: this.name,
stackSize: this.stackSize,
maxStackSize: cardElementData.find(card => card.name === this.name)?.stackSize ?? undefined,
icon: `${basePath()}/item-card/InventoryIcon.png`,
w: 1,
h: 1,
identified: true,
frameType: 6,
league: 'Standard',
inventoryId: '',
name: '',
x: 0,
y: 0,
id: '',
verified: false,
typeLine: this.name,
ilvl: 0,
}}
></poe-item>`;
}
static { this.styles = css `
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
:host {
display: inline-block;
width: fit-content;
}
`; }
};
__decorate([
property({ reflect: true }),
__metadata("design:type", Object)
], PoeItemCardElement.prototype, "name", void 0);
__decorate([
property({ type: Number, attribute: 'stack-size' }),
__metadata("design:type", Number)
], PoeItemCardElement.prototype, "stackSize", void 0);
PoeItemCardElement = __decorate([
customElement('poe-item-card')
], PoeItemCardElement);
export { PoeItemCardElement };
//# sourceMappingURL=poe-item-card.js.map