antd 5.2.0

This commit is contained in:
Wang Kejun 2023-02-16 11:10:54 +08:00
parent 823816c260
commit d50742d514
5 changed files with 18 additions and 62 deletions

View File

@ -5,6 +5,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
var icons_1 = require("@ant-design/icons");
var dayjs_1 = tslib_1.__importDefault(require("dayjs"));
var qrcode_react_1 = require("qrcode.react");
require("./index.less");
function isBase64(url) {
return /data:image\/[\w|\W]+(;base64,)$/.test(url);
@ -33,7 +34,8 @@ function QrCode(props) {
return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ id: "oakQrCode", className: "".concat(prefixCls, "-qrCodeBox") }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_imgBox"), style: {
width: size,
height: size,
} }, { children: isBase64(url) ? ((0, jsx_runtime_1.jsx)("img", { src: url, alt: "qrCode", width: size, height: size })) : (url ? (0, jsx_runtime_1.jsx)(antd_1.QRCode, { value: url, size: size }) : null) })), V, tips, (0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_actions") }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "text", onClick: function () {
marginBottom: 10
} }, { children: isBase64(url) ? ((0, jsx_runtime_1.jsx)("img", { src: url, alt: "qrCode", width: size, height: size })) : url ? ((0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeCanvas, { value: url, size: size })) : null })), V, tips, (0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_actions") }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "text", onClick: function () {
var _a;
if (typeof onDownload === 'function') {
onDownload(url, filename);

View File

@ -31,7 +31,7 @@
},
"peerDependencies": {
"@ant-design/icons": "^4.7.0",
"antd": "^5.2.1",
"antd": "^5.2.0",
"antd-mobile": "^5.24.1",
"antd-mobile-icons": "^0.3.0",
"react": ">=18.2.0",
@ -56,7 +56,7 @@
"@types/react-dom": "^18.0.5",
"@types/sha1": "^1.1.3",
"@types/uuid": "^8.3.0",
"antd": "^5.2.1",
"antd": "^5.2.0",
"antd-mobile": "^5.24.1",
"antd-mobile-icons": "^0.3.0",
"assert": "^2.0.0",

View File

@ -1,7 +1,8 @@
import React, { useState, useEffect } from 'react';
import { Button, Space, QRCode } from 'antd';
import { Button, Space } from 'antd';
import { DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
import dayjs from 'dayjs';
import { QRCodeCanvas } from 'qrcode.react';
import './index.less';
@ -77,13 +78,14 @@ function QrCode(props: IQrCodeProps) {
style={{
width: size,
height: size,
marginBottom: 10
}}
>
{isBase64(url) ? (
<img src={url} alt="qrCode" width={size} height={size} />
) : (
url ? <QRCode value={url} size={size} /> : null
)}
) : url ? (
<QRCodeCanvas value={url} size={size} />
) : null}
</div>
{V}
{tips}

View File

@ -27,19 +27,7 @@
&_btn {
margin-top: 16px;
width: 80px;
height: 80px;
border-radius: 40px;
background-color: transparent;
color: #000000d9;
border: 1px solid #d9d9d9;
font-size: 14px;
line-height: 24px;
box-shadow: 0 2px #00000004;
cursor: pointer;
transition: .3s;
margin-bottom: 16px;
}
}
@ -47,7 +35,6 @@
&_bottom {
display: flex;
flex-direction: column;
margin-top: 16px;
&_title {
font-size: 13px;
@ -70,8 +57,8 @@
height: 180px;
display: flex;
flex-direction: column;
justify-content: center;
flex-direction: column;
justify-content: center;
&_header {
display: flex;
@ -80,51 +67,14 @@
&_btn {
margin-top: 16px;
width: 80px;
height: 80px;
border-radius: 40px;
background-color: transparent;
color: #000000d9;
border: 1px solid #d9d9d9;
font-size: 14px;
line-height: 24px;
box-shadow: 0 2px #00000004;
cursor: pointer;
transition: .3s;
margin-bottom: 16px;
}
&_btn:hover {
color: var(--oak-color-primary);
border-color: currentColor;
}
&_btn::after {
/*其他样式*/
opacity: 0;
box-shadow: 0 0 0 6px var(--oak-color-primary);
transition: .3s;
}
/*点击*/
&_btn:active::after {
box-shadow: none;
opacity: 0.4;
transition: 0s;
/*取消过渡*/
}
}
&_bottom {
display: flex;
flex-direction: column;
margin-top: 16px;
&_title {
font-size: 13px;

View File

@ -66,6 +66,7 @@ function Grant(props: GrantProps) {
}}
></input>
<Button
className={`${prefixCls2}_dev_header_btn`}
type="primary"
shape="round"
size="large"
@ -99,10 +100,11 @@ function Grant(props: GrantProps) {
<div className={`${prefixCls2}_prod`}>
<div className={`${prefixCls2}_prod_header`}>
<Button
className={`${prefixCls2}_prod_header_btn`}
type="primary"
shape="round"
size="large"
// block
// block
onClick={() => {
if (disabled) {
messageApi.info(disableText || 'disabled');