tdesign-vue
Version:
70 lines (66 loc) • 2.66 kB
JavaScript
/**
* tdesign v1.12.1
* (c) 2025 tdesign
* @license MIT
*/
import { computed } from '@vue/composition-api';
import { useConfig } from '../config-provider/useConfig.js';
export { useConfig } from '../config-provider/useConfig.js';
import '../config-provider/context.js';
import 'lodash-es';
import '../_common/js/global-config/default-config.js';
import '../_common/js/global-config/locale/zh_CN.js';
import '../_chunks/dep-c44a474d.js';
import '@babel/runtime/helpers/typeof';
import '../_chunks/dep-d639fbd7.js';
import 'dayjs';
import '../_chunks/dep-3c66615e.js';
import '../config-provider/type.js';
import '../_common/js/global-config/t.js';
import '@babel/runtime/helpers/slicedToArray';
function usePrefixClass(componentName) {
var _useConfig = useConfig("classPrefix"),
classPrefix = _useConfig.classPrefix;
return computed(function () {
return componentName ? "".concat(classPrefix.value, "-").concat(componentName) : classPrefix.value;
});
}
function useCommonClassName() {
var _useConfig2 = useConfig("classPrefix"),
classPrefix = _useConfig2.classPrefix;
return {
classPrefix: classPrefix,
SIZE: computed(function () {
return {
small: "".concat(classPrefix.value, "-size-s"),
medium: "".concat(classPrefix.value, "-size-m"),
large: "".concat(classPrefix.value, "-size-l"),
"default": "",
xs: "".concat(classPrefix.value, "-size-xs"),
xl: "".concat(classPrefix.value, "-size-xl"),
block: "".concat(classPrefix.value, "-size-full-width")
};
}),
STATUS: computed(function () {
return {
loading: "".concat(classPrefix.value, "-is-loading"),
loadMore: "".concat(classPrefix.value, "-is-load-more"),
disabled: "".concat(classPrefix.value, "-is-disabled"),
focused: "".concat(classPrefix.value, "-is-focused"),
success: "".concat(classPrefix.value, "-is-success"),
error: "".concat(classPrefix.value, "-is-error"),
warning: "".concat(classPrefix.value, "-is-warning"),
selected: "".concat(classPrefix.value, "-is-selected"),
active: "".concat(classPrefix.value, "-is-active"),
checked: "".concat(classPrefix.value, "-is-checked"),
current: "".concat(classPrefix.value, "-is-current"),
hidden: "".concat(classPrefix.value, "-is-hidden"),
visible: "".concat(classPrefix.value, "-is-visible"),
expanded: "".concat(classPrefix.value, "-is-expanded"),
indeterminate: "".concat(classPrefix.value, "-is-indeterminate")
};
})
};
}
export { useCommonClassName, usePrefixClass };
//# sourceMappingURL=useConfig.js.map