@paro.io/expert-shared-components 1.14.40 → 1.14.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
- package/lib/components/ClientReferencesSection/ParoError.js +10 -10
- package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
- package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
- package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
- package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
- package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
- package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
- package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
- package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
- package/lib/components/DiscussionThread/DiscussionThread.d.ts +25 -25
- package/lib/components/DiscussionThread/DiscussionThread.js +137 -137
- package/lib/components/DiscussionThread/chat.d.ts +22 -22
- package/lib/components/DiscussionThread/chat.js +106 -106
- package/lib/components/DiscussionThread/index.d.ts +1 -1
- package/lib/components/DiscussionThread/index.js +5 -5
- package/lib/components/DocumentCenter/ClientDocumentsTable.d.ts +3 -1
- package/lib/components/DocumentCenter/ClientDocumentsTable.js +6 -16
- package/lib/components/DocumentCenter/DocumentCenter.js +8 -1
- package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
- package/lib/components/DocumentCenter/DocumentTable.js +350 -350
- package/lib/components/DocumentCenter/DragDropUpload.d.ts +10 -0
- package/lib/components/DocumentCenter/DragDropUpload.js +124 -0
- package/lib/components/DocumentCenter/MultiFileUploadSection.d.ts +17 -0
- package/lib/components/DocumentCenter/MultiFileUploadSection.js +672 -0
- package/lib/components/DocumentCenter/ParoDocumentsTable.js +2 -2
- package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
- package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
- package/lib/components/DocumentCenter/index.d.ts +3 -1
- package/lib/components/DocumentCenter/index.js +5 -1
- package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
- package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
- package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
- package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
- package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
- package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
- package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
- package/lib/components/EarningsTracker/EditDateModal.js +149 -149
- package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
- package/lib/components/EarningsTracker/EmailModal.js +79 -79
- package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
- package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
- package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
- package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
- package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
- package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
- package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
- package/lib/components/EarningsTracker/ProgressBar.js +66 -66
- package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
- package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
- package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
- package/lib/components/EarningsTracker/RightCardUI.js +231 -231
- package/lib/components/EarningsTracker/index.d.ts +1 -1
- package/lib/components/EarningsTracker/index.js +5 -5
- package/lib/components/Escalations/CustomTag.d.ts +3 -3
- package/lib/components/Escalations/CustomTag.js +25 -25
- package/lib/components/Escalations/ViewReponseModal.d.ts +8 -8
- package/lib/components/Escalations/ViewReponseModal.js +27 -27
- package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
- package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
- package/lib/components/Invoices/DiscussionSection.js +33 -17
- package/lib/components/Invoices/TestDecisionSection.d.ts +1 -1
- package/lib/components/Invoices/TestDecisionSection.js +126 -126
- package/lib/components/OrganizationChart/OrganizationChart.d.ts +15 -15
- package/lib/components/OrganizationChart/OrganizationChart.js +312 -312
- package/lib/components/OrganizationChart/PersonCard.js +5 -5
- package/lib/components/OrganizationChart/utils.js +79 -79
- package/lib/components/ProjectCard/ProgressBar.js +4 -4
- package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
- package/lib/components/ProjectIntelligence/MissingInformation/index.js +1 -1
- package/lib/components/Reviews/Pagination.js +6 -6
- package/lib/components/ReviewsTab/RatingHeader.js +6 -6
- package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
- package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
- package/lib/components/shared/Image.js +13 -13
- package/lib/components/shared/ProfileTextField.d.ts +18 -18
- package/lib/components/shared/ProfileTextField.js +16 -16
- package/lib/components/shared/StyledActionButtons.d.ts +7 -7
- package/lib/components/shared/StyledActionButtons.js +15 -15
- package/lib/components/shared/ToastNotification.d.ts +10 -10
- package/lib/components/shared/ToastNotification.js +63 -63
- package/package.json +67 -67
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface DragDropUploadProps {
|
|
3
|
+
onFilesSelected: (files: File[]) => void;
|
|
4
|
+
maxFileSize?: number;
|
|
5
|
+
acceptedFileTypes?: string[];
|
|
6
|
+
maxFiles?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DragDropUpload: React.FC<DragDropUploadProps>;
|
|
10
|
+
export default DragDropUpload;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DragDropUpload = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const core_1 = require("@material-ui/core");
|
|
29
|
+
const utils_1 = require("../shared/utils");
|
|
30
|
+
const DragDropUpload = ({ onFilesSelected, maxFileSize = 10, acceptedFileTypes = [".pdf", ".doc", ".xls", ".csv", ".jpg", ".png"], maxFiles = 10, disabled = false, }) => {
|
|
31
|
+
const [isDragging, setIsDragging] = (0, react_1.useState)(false);
|
|
32
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
33
|
+
const dragCounter = (0, react_1.useRef)(0);
|
|
34
|
+
const validateFiles = (files) => {
|
|
35
|
+
const validFiles = [];
|
|
36
|
+
files.forEach((file) => {
|
|
37
|
+
var _a;
|
|
38
|
+
// Check file size
|
|
39
|
+
const fileSizeMB = file.size / (1024 * 1024);
|
|
40
|
+
if (fileSizeMB > maxFileSize) {
|
|
41
|
+
(0, utils_1.showToast)("warning", `${file.name} exceeds maximum file size of ${maxFileSize}MB`);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Check file type
|
|
45
|
+
const fileExtension = "." + ((_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
46
|
+
if (!acceptedFileTypes.includes(fileExtension)) {
|
|
47
|
+
(0, utils_1.showToast)("warning", `${file.name} has an unsupported file type`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
validFiles.push(file);
|
|
51
|
+
});
|
|
52
|
+
return validFiles;
|
|
53
|
+
};
|
|
54
|
+
const handleFiles = (files) => {
|
|
55
|
+
if (!files || files.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
const fileArray = Array.from(files);
|
|
58
|
+
const validFiles = validateFiles(fileArray);
|
|
59
|
+
if (validFiles.length > 0) {
|
|
60
|
+
onFilesSelected(validFiles);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const handleDragEnter = (0, react_1.useCallback)((e) => {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
dragCounter.current++;
|
|
67
|
+
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
|
|
68
|
+
setIsDragging(true);
|
|
69
|
+
}
|
|
70
|
+
}, []);
|
|
71
|
+
const handleDragLeave = (0, react_1.useCallback)((e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
dragCounter.current--;
|
|
75
|
+
if (dragCounter.current === 0) {
|
|
76
|
+
setIsDragging(false);
|
|
77
|
+
}
|
|
78
|
+
}, []);
|
|
79
|
+
const handleDragOver = (0, react_1.useCallback)((e) => {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
e.stopPropagation();
|
|
82
|
+
}, []);
|
|
83
|
+
const handleDrop = (0, react_1.useCallback)((e) => {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
setIsDragging(false);
|
|
87
|
+
dragCounter.current = 0;
|
|
88
|
+
if (disabled)
|
|
89
|
+
return;
|
|
90
|
+
const files = e.dataTransfer.files;
|
|
91
|
+
handleFiles(files);
|
|
92
|
+
}, [disabled]);
|
|
93
|
+
const handleFileInputChange = (e) => {
|
|
94
|
+
handleFiles(e.target.files);
|
|
95
|
+
// Reset input value to allow selecting the same file again
|
|
96
|
+
if (fileInputRef.current) {
|
|
97
|
+
fileInputRef.current.value = "";
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const handleBrowseClick = () => {
|
|
101
|
+
var _a;
|
|
102
|
+
(_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
103
|
+
};
|
|
104
|
+
return (react_1.default.createElement(core_1.Box, { className: "w-full" },
|
|
105
|
+
react_1.default.createElement(core_1.Box, { onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, className: `
|
|
106
|
+
relative border-2 border-dashed rounded-lg p-8 text-center transition-all duration-200
|
|
107
|
+
${isDragging
|
|
108
|
+
? "border-blue-500 bg-blue-50"
|
|
109
|
+
: "border-gray-300 bg-gray-50 hover:border-gray-400"}
|
|
110
|
+
${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
111
|
+
`, onClick: !disabled ? handleBrowseClick : undefined },
|
|
112
|
+
react_1.default.createElement("input", { ref: fileInputRef, type: "file", multiple: true, accept: acceptedFileTypes.join(","), onChange: handleFileInputChange, style: { display: "none" }, disabled: disabled }),
|
|
113
|
+
react_1.default.createElement(core_1.Box, { className: "flex flex-col items-center justify-center space-y-4" },
|
|
114
|
+
react_1.default.createElement(core_1.Box, { className: "text-6xl" }, "\uD83D\uDCC1"),
|
|
115
|
+
react_1.default.createElement(core_1.Typography, { variant: "body1", className: "text-gray-700" },
|
|
116
|
+
react_1.default.createElement("span", { className: "font-semibold" }, "Drag & drop files here, or "),
|
|
117
|
+
react_1.default.createElement("span", { className: "text-blue-600 underline cursor-pointer" }, "browse")),
|
|
118
|
+
react_1.default.createElement(core_1.Typography, { variant: "caption", className: "text-gray-500" },
|
|
119
|
+
"PDF, DOC, XLS, CSV, JPG, PNG \u2014 max ",
|
|
120
|
+
maxFileSize,
|
|
121
|
+
"MB per file")))));
|
|
122
|
+
};
|
|
123
|
+
exports.DragDropUpload = DragDropUpload;
|
|
124
|
+
exports.default = exports.DragDropUpload;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MultiFileUploadSectionProps {
|
|
3
|
+
paroDocuments: boolean;
|
|
4
|
+
clientAndProjectsList?: any[];
|
|
5
|
+
uploadExpertClientFiles?: any;
|
|
6
|
+
uploadInternalFile?: any;
|
|
7
|
+
foldername?: string;
|
|
8
|
+
refetchFiles?: any;
|
|
9
|
+
legacyFreelancerId?: any;
|
|
10
|
+
freelancerName?: string;
|
|
11
|
+
freelancerEmail?: string;
|
|
12
|
+
isClientPortal?: boolean;
|
|
13
|
+
documentUploadUrl?: string;
|
|
14
|
+
showAsPage: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const MultiFileUploadSection: React.FC<MultiFileUploadSectionProps>;
|
|
17
|
+
export default MultiFileUploadSection;
|