@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
93 lines (92 loc) • 2.46 kB
JavaScript
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const common_utils = require("../../common/utils.cjs");
const vue = require("vue");
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
const _sfc_main = {
compatConfig: { MODE: 3 },
name: "DtCard",
props: {
/**
* The maximum height of the card content.
* If given, makes content area scrollable.
*/
maxHeight: {
type: String,
default: null
},
/**
* class for card container.
*/
containerClass: {
type: [String, Array, Object],
default: ""
},
/**
* class for card content.
*/
contentClass: {
type: [String, Array, Object],
default: ""
},
/**
* class for card header.
*/
headerClass: {
type: [String, Array, Object],
default: ""
},
/**
* class for card footer.
*/
footerClass: {
type: [String, Array, Object],
default: ""
}
},
data() {
return {
hasSlotContent: common_utils.hasSlotContent
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", {
class: vue.normalizeClass([
"d-card",
$props.containerClass
]),
"data-qa": "dt-card"
}, [
$data.hasSlotContent(_ctx.$slots.header) ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass([
"d-card__header",
$props.headerClass
])
}, [
vue.renderSlot(_ctx.$slots, "header")
], 2)) : vue.createCommentVNode("", true),
vue.createElementVNode("div", {
class: vue.normalizeClass([
"d-card__content",
$props.contentClass
]),
style: vue.normalizeStyle({ "max-height": $props.maxHeight })
}, [
vue.renderSlot(_ctx.$slots, "content")
], 6),
$data.hasSlotContent(_ctx.$slots.footer) ? (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: vue.normalizeClass([
"d-card__footer",
$props.footerClass
])
}, [
vue.renderSlot(_ctx.$slots, "footer")
], 2)) : vue.createCommentVNode("", true)
], 2);
}
const DtCard = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
exports.default = DtCard;
//# sourceMappingURL=card.vue.cjs.map