tdesign-vue-next
Version:
TDesign Component for vue-next
66 lines (62 loc) • 2.58 kB
JavaScript
/**
* tdesign v1.20.2
* (c) 2026 tdesign
* @license MIT
*/
import { defineComponent, computed, createVNode } from 'vue';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import props from './props.js';
import 'lodash-es';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-d9440b5f.js';
import { a as useContent } from '../_chunks/dep-b3575781.js';
import { u as usePrefixClass } from '../_chunks/dep-4d7f902f.js';
import '@babel/runtime/helpers/slicedToArray';
import '../_chunks/dep-dfeea6f5.js';
import { p as pxCompat } from '../_chunks/dep-9e860115.js';
import '../_chunks/dep-a6042a25.js';
import '../_chunks/dep-41cafcc6.js';
import '../_chunks/dep-43a3baa0.js';
import '../config-provider/hooks/useConfig.js';
import '../config-provider/utils/context.js';
import '../_chunks/dep-854d2777.js';
import 'dayjs';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/objectWithoutProperties';
var _Divider = defineComponent({
name: "TDivider",
props: props,
setup: function setup(props2) {
var COMPONENT_NAME = usePrefixClass("divider");
var renderContent = useContent();
return function () {
var children = renderContent("default", "content");
var isHorizontal = computed(function () {
return props2.layout !== "vertical";
});
var showText = computed(function () {
return isHorizontal.value && !!children;
});
var dividerClassNames = ["".concat(COMPONENT_NAME.value), ["".concat(COMPONENT_NAME.value, "--").concat(props2.layout)], _defineProperty(_defineProperty(_defineProperty({}, "".concat(COMPONENT_NAME.value, "--dashed"), !!props2.dashed), "".concat(COMPONENT_NAME.value, "--with-text"), !!showText.value), "".concat(COMPONENT_NAME.value, "--with-text-").concat(props2.align), !!showText.value)];
var dividerWrapperStyle = computed(function () {
if (props2.size) {
var margin = isHorizontal.value ? "".concat(pxCompat(props2.size), " 0") : "0 ".concat(pxCompat(props2.size));
return {
margin: margin
};
}
return null;
});
return createVNode("div", {
"class": dividerClassNames,
"style": dividerWrapperStyle.value
}, [showText.value && createVNode("span", {
"class": "".concat(COMPONENT_NAME.value, "__inner-text")
}, [children])]);
};
}
});
export { _Divider as default };
//# sourceMappingURL=divider.js.map