2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-fileupload input[type="file"] {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-advanced {
|
|
|
|
border: 1px solid ${dt('fileupload.border.color')};
|
|
|
|
border-radius: ${dt('rounded.base')};
|
|
|
|
background: ${dt('fileupload.background')};
|
|
|
|
color: ${dt('fileupload.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-header {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
padding: 1.125rem;
|
|
|
|
gap: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-content {
|
|
|
|
border: 1px solid transparent;
|
|
|
|
position: relative;
|
|
|
|
padding: 0 1.125rem 1.125rem 1.125rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-content .p-progressbar {
|
|
|
|
width: 100%;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
height: 0.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-file-list {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 0.5rem;
|
|
|
|
margin-top: 1.125rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-file {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
align-items: center;
|
|
|
|
padding: 1rem;
|
|
|
|
border-bottom: 1px solid ${dt('fileupload.file.border.color')};
|
|
|
|
gap: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-file:last-child {
|
|
|
|
border-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-file-info {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-file-thumbnail {
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-file-actions {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-highlight {
|
|
|
|
border: 1px dashed ${dt('fileupload.content.highlight.border.color')};
|
|
|
|
background: ${dt('fileupload.content.highlight.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fileupload-advanced .p-message {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [`p-fileupload p-fileupload-${props.mode} p-component`],
|
2024-04-30 09:58:12 +00:00
|
|
|
header: 'p-fileupload-header',
|
|
|
|
chooseButton: 'p-fileupload-choose-button',
|
|
|
|
uploadButton: 'p-fileupload-upload-button',
|
|
|
|
clearButton: 'p-fileupload-clear-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
content: 'p-fileupload-content',
|
2024-04-20 12:45:44 +00:00
|
|
|
fileList: 'p-fileupload-file-list',
|
2023-10-02 10:46:09 +00:00
|
|
|
file: 'p-fileupload-file',
|
2024-04-30 09:58:12 +00:00
|
|
|
fileThumbnail: 'p-fileupload-file-thumbnail',
|
|
|
|
fileInfo: 'p-fileupload-file-info',
|
2023-10-02 10:46:09 +00:00
|
|
|
fileName: 'p-fileupload-file-name',
|
|
|
|
fileSize: 'p-fileupload-file-size',
|
2024-04-30 09:58:12 +00:00
|
|
|
fileBadge: 'p-fileupload-file-badge',
|
|
|
|
fileActions: 'p-fileupload-file-actions',
|
|
|
|
fileRemoveButton: 'p-fileupload-file-remove-button'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'fileupload',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|