'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index$1 = require('./index-df541290.js');
const index$2 = require('./index-c12b8888.js');
const index = require('./index-b7493032.js');
require('./index-0b6f1dd9.js');
require('./_commonjsHelpers-10109b76.js');
require('./index-fe328b96.js');

const sv = {
  "@": "à",
  "Remove item": "Ta bort artikel",
};

function create(language) {
  return index.dist.create({
    sv,
  }, language);
}

const styleCss = ".sc-ig-display-item-h{display:block}[hidden].sc-ig-display-item-h{display:none}.sc-ig-display-item-h>section.sc-ig-display-item{margin-left:.3em;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.sc-ig-display-item-h>section.sc-ig-display-item>span.sc-ig-display-item{margin-bottom:0.8em;padding-left:1.5em;white-space:nowrap;overflow:hidden;text-overflow:visible}.sc-ig-display-item-h>section.sc-ig-display-item>span.medium.sc-ig-display-item{-ms-flex-positive:2;flex-grow:2}.sc-ig-display-item-h>section.sc-ig-display-item>span.small.sc-ig-display-item{-ms-flex-positive:1;flex-grow:1}.sc-ig-display-item-h>section.sc-ig-display-item>span.big.sc-ig-display-item{-ms-flex-positive:3;flex-grow:3}.left.sc-ig-display-item{border-left:1px solid rgb(var(--smoothly-medium-color))}.sc-ig-display-item-h>section.sc-ig-display-item>smoothly-trigger.sc-ig-display-item{margin-right:0px;margin-left:8px;margin-top:-3px;float:right}";

const IntergiroDisplayItem = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
    this.itemDeleted = index$1.createEvent(this, "itemDeleted", 7);
    this.item = {};
    this.removable = true;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  delete(event) {
    if (event.detail.name == "item") {
      event.stopPropagation();
      this.itemDeleted.emit({ index: this.index });
    }
  }
  render() {
    const t = this.t;
    return [
      this.item ? (index$1.h("section", null, index$1.h("span", { class: "small" }, this.item.quantity ? this.item.quantity : this.item.unit ? 1 : "", " ", this.item.unit), index$1.h("span", { class: "big" }, this.item.name), index$1.h("span", { class: "medium" }, t("@"), " ", index$2.Item.amount(this.item) / (this.item.quantity ? this.item.quantity : 1), " ", this.currency), index$1.h("span", { class: "medium" }, index$2.Item.amount(this.item), " ", this.currency), this.removable ? (index$1.h("smoothly-trigger", { fill: "clear", name: "item" }, index$1.h("smoothly-icon", { size: "small", toolTip: t("Remove item"), name: "trash" }))) : (""))) : (""),
    ];
  }
  get element() { return index$1.getElement(this); }
};
IntergiroDisplayItem.style = styleCss;

exports.ig_display_item = IntergiroDisplayItem;
