@vuesax-alpha/nightly
Version:
A Component Library for Vue 3
84 lines (79 loc) • 2.71 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
require('../../../hooks/index.js');
var expand$1 = require('./expand.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../hooks/use-namespace/index.js');
const _hoisted_1 = ["colspan"];
const __default__ = vue.defineComponent({
name: "VsTableExpand"
});
const _sfc_main = vue.defineComponent({
...__default__,
props: expand$1.expandProps,
setup(__props) {
const ns = index.useNamespace("table");
const hidden = vue.ref(true);
const trRef = vue.ref();
const contentRef = vue.ref();
vue.watch(hidden, (val) => {
if (!val) {
vue.nextTick(() => {
const content = contentRef.value;
if (!content)
return;
content.style.height = `${content.scrollHeight}px`;
});
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.Transition, { name: "fade-expand" }, {
default: vue.withCtx(() => [
!hidden.value ? (vue.openBlock(), vue.createElementBlock(
"tr",
{
key: 0,
ref_key: "trRef",
ref: trRef,
class: vue.normalizeClass(vue.unref(ns).be("tr-expand", "row"))
},
[
vue.createElementVNode("td", {
class: vue.normalizeClass(vue.unref(ns).be("tr-expand", "td")),
colspan: _ctx.colspan
}, [
vue.createElementVNode(
"div",
{
ref_key: "contentRef",
ref: contentRef,
class: vue.normalizeClass(vue.unref(ns).be("tr-expand", "content"))
},
[
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(vue.unref(ns).bem("tr-expand", "content", "inner"))
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
)
],
2
)
], 10, _hoisted_1)
],
2
)) : vue.createCommentVNode("v-if", true)
]),
_: 3
});
};
}
});
var expand = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/vuesax-alpha/vuesax-alpha/packages/components/table/src/expand.vue"]]);
exports["default"] = expand;
//# sourceMappingURL=expand2.js.map