123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- import { CloseOutlined } from "@ant-design/icons";
- import { Upload, UploadProps } from "antd";
- import { FC } from "react";
- import { css, keyframes, styled } from "styled-components";
- const { Dragger } = Upload;
- export const UploadTips = styled.p`
- color: #999999;
- font-size: 12px;
- `;
- export const UploadContainer = styled.div.attrs({
- className: "dage-upload",
- })`
- display: inline-block;
- min-width: 320px;
- `;
- const uploadStyle = css`
- .ant-btn:has(.hide) {
- display: none;
- }
- `;
- export const AntdUpload = styled(Upload)`
- ${uploadStyle}
- ` as FC<UploadProps>;
- export const AntdDragger = styled(Dragger)`
- ${uploadStyle}
- ` as FC<UploadProps>;
- export const AntdDraggerText = styled.p`
- margin: 14px 0;
- `;
- export const UploadFileItem = styled.div<{
- showdownloadprogress: string;
- }>`
- display: flex;
- align-items: center;
- position: relative;
- margin-top: 8px;
- height: 24px;
- border-radius: 4px;
- transition: all 0.3s;
- &:hover {
- background-color: rgba(0, 0, 0, 0.04);
- }
- ${({ showdownloadprogress }) =>
- showdownloadprogress === "true" &&
- css`
- margin-bottom: 10px;
- `}
- .ant-upload-list-item {
- flex: 1;
- width: 0;
- height: 100% !important;
- margin: 0 !important;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- &:hover {
- background: none !important;
- }
- }
- `;
- export const UploadFileItemActions = styled.div`
- display: none;
- white-space: nowrap;
- ${UploadFileItem}:hover & {
- display: block;
- }
- .ant-btn {
- color: #666;
- }
- `;
- export const UploadPictureItem = styled.div`
- position: relative;
- height: 100%;
- &:hover::before {
- opacity: 1;
- }
- &::before {
- position: absolute;
- top: 8px;
- left: 8px;
- z-index: 1;
- width: calc(100% - 16px);
- height: calc(100% - 16px);
- background-color: rgba(0, 0, 0, 0.45);
- opacity: 0;
- transition: all 0.3s;
- content: " ";
- }
- .ant-upload-list-item::before {
- display: none;
- }
- `;
- export const UploadPictureItemActions = styled.div`
- display: none;
- position: absolute;
- top: 50%;
- left: 50%;
- white-space: nowrap;
- transform: translate(-50%, -50%);
- z-index: 2;
- ${UploadPictureItem}:hover & {
- display: block;
- }
- .ant-btn {
- color: rgba(255, 255, 255, 0.65);
- &:hover {
- color: white !important;
- }
- }
- `;
- const fadeInAnimation = keyframes`
- 0% { opacity: 0; }
- 100% { opacity: 1; }
- `;
- export const DownloadProgress = styled.div`
- display: flex;
- align-items: center;
- position: absolute;
- left: 0;
- right: 0;
- bottom: -15px;
- animation: ${fadeInAnimation} 0.2s ease-in-out;
- `;
- export const DownloadCancelBtn = styled(CloseOutlined)`
- position: relative;
- top: 2px;
- margin-left: 5px;
- color: #999;
- cursor: pointer;
- `;
|