/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

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

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');
var components_divider_props = require('./props.js');
require('vue');
require('lodash');
require('lodash/mergeWith');
require('../config-provider/context.js');
require('../../chunks/zh_CN.js');

var _Divider = utils_mixins["default"](components_configProvider_configReceiver.getClassPrefixMixins("divider")).extend({
  name: "LDivider",
  props: {
    ...components_divider_props["default"]
  },
  render() {
    const h = arguments[0];
    const {
      componentName: NAME,
      commonSizeClassName: SIZE
    } = this;
    const isSetSize = this.size && ["small", "medium", "large"].includes(this.size);
    const children = this.layout !== "vertical" && utils_renderNode.renderContent(this, "default", "content");
    const classes = [`${NAME}`, [`${NAME}--${this.layout || "horizontal"}`], {
      [`${NAME}--dashed`]: !!this.dashed,
      [`${NAME}--with-text`]: !!children,
      [`${NAME}--with-text-${this.align}`]: !!children,
      [SIZE[this.size]]: isSetSize
    }];
    let styles = {};
    if (!isSetSize) {
      styles = this.layout === "horizontal" ? {
        margin: `${this.size} 0`
      } : {
        margin: `0 ${this.size}`
      };
    }
    return h("div", {
      "style": styles,
      "class": classes
    }, [children && h("span", {
      "class": `${NAME}__inner-text`
    }, [children])]);
  }
});

exports["default"] = _Divider;
//# sourceMappingURL=divider.js.map
