UNPKG

tdesign-vue-next

Version:
87 lines (83 loc) 3.39 kB
/** * tdesign v1.19.2 * (c) 2026 tdesign * @license MIT */ import { defineComponent, createVNode, computed, Fragment } from 'vue'; import { QRCodeStatusProps } from './props.mjs'; import { RefreshIcon, CheckCircleFilledIcon } from 'tdesign-icons-vue-next'; import { Loading } from '../../loading/index.mjs'; import { u as usePrefixClass } from '../../_chunks/dep-fbeb2963.mjs'; import '../../loading/directive.mjs'; import 'lodash-es'; import '../../loading/plugin.mjs'; import '../../loading/loading.mjs'; import '../../_chunks/dep-f558ebb8.mjs'; import '../../_chunks/dep-b0b422fe.mjs'; import '../../_chunks/dep-ba214d75.mjs'; import '../../_chunks/dep-e1c62679.mjs'; import '../../loading/icon/gradient.mjs'; import '../../_chunks/dep-58979704.mjs'; import '../../_chunks/dep-47c3cae9.mjs'; import '../../_chunks/dep-c231a5b4.mjs'; import '../../_chunks/dep-feed89df.mjs'; import '../../_chunks/dep-5b510fcd.mjs'; import '../../loading/props.mjs'; import '../../config-provider/hooks/useConfig.mjs'; import '../../config-provider/utils/context.mjs'; import '../../_chunks/dep-e0ab6d55.mjs'; import '../../_chunks/dep-75f265c4.mjs'; import '../../_chunks/dep-67ffcfeb.mjs'; import '../../_chunks/dep-edab0e6a.mjs'; import '../../_chunks/dep-76dddedf.mjs'; import '../../_chunks/dep-d92220c4.mjs'; import '../../_chunks/dep-466a8f31.mjs'; import '../../_chunks/dep-e66c0337.mjs'; import './style/css.mjs'; var QRcodeStatus = defineComponent({ name: "QRCodeStatus", props: QRCodeStatusProps, setup: function setup(props) { var _props$locale3; var classPrefix = usePrefixClass(); var defaultSpin = createVNode(Loading, { "size": "32px" }, null); var defaultExpiredNode = computed(function () { var _props$locale, _props$locale2; return createVNode(Fragment, null, [createVNode("p", { "class": "".concat(classPrefix.value, "-expired__text") }, [(_props$locale = props.locale) === null || _props$locale === void 0 ? void 0 : _props$locale.expiredText]), (props === null || props === void 0 ? void 0 : props.onRefresh) && createVNode("p", { "class": "".concat(classPrefix.value, "-expired__button"), "onClick": props === null || props === void 0 ? void 0 : props.onRefresh }, [createVNode(RefreshIcon, { "size": "16" }, null), (_props$locale2 = props.locale) === null || _props$locale2 === void 0 ? void 0 : _props$locale2.refreshText])]); }); var defaultScannedNode = createVNode("p", { "class": "".concat(classPrefix.value, "-scanned") }, [createVNode(CheckCircleFilledIcon, { "size": "16", "class": "".concat(classPrefix.value, "-scanned__icon") }, null), (_props$locale3 = props.locale) === null || _props$locale3 === void 0 ? void 0 : _props$locale3.scannedText]); var defaultNodes = computed(function () { return { expired: defaultExpiredNode.value, loading: defaultSpin, scanned: defaultScannedNode, active: null }; }); var renderStatus = function renderStatus(info) { return defaultNodes.value[info.status]; }; return function () { return createVNode(Fragment, null, [props.statusRender || renderStatus({ status: props.status, onRefresh: props.onRefresh })]); }; } }); export { QRcodeStatus as default }; //# sourceMappingURL=qrcode-status.mjs.map