import { dvnCardListViewI18nDefault } from '@dvn/core/components/views/dvn-card-list-view/i18n';
import { Component, h, Host, Prop } from '@stencil/core';
export class DvnCardListView {
  constructor() {
    this.fields = [];
    this.items = [];
    this.strings = dvnCardListViewI18nDefault;
  }
  render() {
    const { config, fields, items, strings } = this;
    if (items.length === 0) {
      return (h(Host, { class: "d-flex justify-content-center p-3" }, strings.noItemInList));
    }
    return (h(Host, { class: "row" }, items.map(item => (h("div", { class: "col-sm-12 col-md-6 col-lg-6 col-xl-6" },
      h("dvn-card-view", { key: `card-view-${item._id}`, config: config.main.cardViewConfig, fields: fields, item: item, overrideStyle: { margin: '0 0 30px 0' }, clip: false }))))));
  }
  static get is() { return "dvn-card-list-view"; }
  static get properties() { return {
    "config": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "CardListViewUIConfig",
        "resolved": "CardListViewUIConfig",
        "references": {
          "CardListViewUIConfig": {
            "location": "import",
            "path": "@dvn/core/models/card-list-view-config"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "fields": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "BaseField[]",
        "resolved": "BaseField[]",
        "references": {
          "BaseField": {
            "location": "import",
            "path": "@dvn/core/doldurma/src/BaseField"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "[]"
    },
    "items": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "DataModel[]",
        "resolved": "DataModel[]",
        "references": {
          "DataModel": {
            "location": "import",
            "path": "@dvn/core/models/data-model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "[]"
    },
    "strings": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "DvnCardListViewI18n",
        "resolved": "DvnCardListViewI18n",
        "references": {
          "DvnCardListViewI18n": {
            "location": "import",
            "path": "@dvn/core/components/views/dvn-card-list-view/i18n"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "dvnCardListViewI18nDefault"
    }
  }; }
}
