UNPKG

tdesign-vue-next

Version:
87 lines (83 loc) 3.39 kB
/** * tdesign v1.20.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-9ce910b6.mjs'; import '../../loading/directive.mjs'; import 'lodash-es'; import '../../loading/plugin.mjs'; import '../../loading/loading.mjs'; import '../../_chunks/dep-ea5fbe21.mjs'; import '../../_chunks/dep-26d65784.mjs'; import '../../_chunks/dep-98dac781.mjs'; import '../../_chunks/dep-f038e2b4.mjs'; import '../../loading/icon/gradient.mjs'; import '../../_chunks/dep-9b3b77bb.mjs'; import '../../_chunks/dep-557b68dd.mjs'; import '../../_chunks/dep-4de66dd0.mjs'; import '../../_chunks/dep-05bddb06.mjs'; import '../../_chunks/dep-57027bda.mjs'; import '../../loading/props.mjs'; import '../../config-provider/hooks/useConfig.mjs'; import '../../config-provider/utils/context.mjs'; import '../../_chunks/dep-57949dcd.mjs'; import '../../_chunks/dep-cafb5eac.mjs'; import '../../_chunks/dep-f1da7269.mjs'; import '../../_chunks/dep-192d0c88.mjs'; import '../../_chunks/dep-652c99fe.mjs'; import '../../_chunks/dep-5b369203.mjs'; import '../../_chunks/dep-a4f55e3b.mjs'; import '../../_chunks/dep-920eff5b.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