/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

'use strict';

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

var components_list_props = require('./props.js');
var utils_renderNode = require('../../utils/render-node.js');
var components_configProvider_configReceiver = require('../config-provider/config-receiver.js');
var utils_mixins = require('../../utils/mixins.js');
require('@babel/runtime/helpers/defineProperty');
require('@babel/runtime/helpers/typeof');
require('vue');
require('lodash/camelCase');
require('lodash/kebabCase');
require('lodash/mergeWith');
require('lodash');
require('../config-provider/context.js');
require('../../chunks/zh_CN.js');

var classPrefixMixins = components_configProvider_configReceiver.getClassPrefixMixins("list-item__meta");
var _ListItemMeta = utils_mixins["default"](classPrefixMixins).extend({
  name: "LListItemMeta",
  props: components_list_props.ListItemMetaProps,
  methods: {
    renderAvatar: function renderAvatar() {
      var h = this.$createElement;

      if (this.avatar || this.$scopedSlots.avatar) {
        console.warn("`avatar` is going to be deprecated, please use `image` instead");
      }

      var thumbnail = utils_renderNode.renderContent(this, "avatar", "image");
      if (!thumbnail) return;

      if (typeof thumbnail === "string") {
        return h("div", {
          "class": "".concat(this.componentName, "-avatar")
        }, [h("img", {
          "attrs": {
            "src": thumbnail
          }
        })]);
      }

      return h("div", {
        "class": "".concat(this.componentName, "-avatar")
      }, [thumbnail]);
    }
  },
  render: function render() {
    var h = arguments[0];
    var propsTitleContent = utils_renderNode.renderLNodeJSX(this, "title");
    var propsDescriptionContent = utils_renderNode.renderLNodeJSX(this, "description");
    var listItemMetaContent = [this.renderAvatar(), h("div", {
      "class": "".concat(this.componentName, "-content")
    }, [propsTitleContent && h("h3", {
      "class": "".concat(this.componentName, "-title")
    }, [propsTitleContent]), propsDescriptionContent && h("p", {
      "class": "".concat(this.componentName, "-description")
    }, [propsDescriptionContent])])];
    return h("div", {
      "class": this.componentName
    }, [listItemMetaContent]);
  }
});

exports["default"] = _ListItemMeta;
//# sourceMappingURL=list-item-meta.js.map
