module-package-comp 2.3.1 → 2.4.0
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/.prettierrc +5 -0
- package/dist/component/ExtraInfoSection.d.ts +6 -0
- package/dist/component/ExtraInfoSection.js +30 -0
- package/dist/component/ExtraInfoSection.js.map +1 -0
- package/dist/component/PdfExportModal.d.ts +2 -3
- package/dist/component/PdfExportModal.js +38 -259
- package/dist/component/PdfExportModal.js.map +1 -1
- package/dist/component/RubricDisplayer.d.ts +4 -5
- package/dist/component/RubricDisplayer.js +53 -41
- package/dist/component/RubricDisplayer.js.map +1 -1
- package/dist/index.css +64 -0
- package/dist/util/pdfExport.d.ts +21 -0
- package/dist/util/pdfExport.js +165 -0
- package/dist/util/pdfExport.js.map +1 -0
- package/dist/util/rubricDisplayer.d.ts +3 -3
- package/dist/util/rubricDisplayer.js +3 -3
- package/dist/util/rubricDisplayer.js.map +1 -1
- package/dist/util/type.d.ts +7 -0
- package/dist/util/type.js.map +1 -1
- package/package.json +1 -1
package/.prettierrc
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type ExtraInfoSectionProps = {
|
|
2
|
+
extraInfo: Record<string, unknown>;
|
|
3
|
+
setExtraInfo: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
|
|
4
|
+
};
|
|
5
|
+
export declare function ExtraInfoSection({ extraInfo, setExtraInfo, }: ExtraInfoSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
export function ExtraInfoSection({ extraInfo, setExtraInfo, }) {
|
|
4
|
+
const [newKey, setNewKey] = useState("");
|
|
5
|
+
const [newValueType, setNewValueType] = useState("text");
|
|
6
|
+
const [newValue, setNewValue] = useState("");
|
|
7
|
+
const handleAdd = () => {
|
|
8
|
+
if (!newKey.trim())
|
|
9
|
+
return;
|
|
10
|
+
let parsedValue = newValue;
|
|
11
|
+
if (newValueType === "number") {
|
|
12
|
+
parsedValue = Number(newValue) || 0;
|
|
13
|
+
}
|
|
14
|
+
else if (newValueType === "boolean") {
|
|
15
|
+
parsedValue = newValue === "true";
|
|
16
|
+
}
|
|
17
|
+
setExtraInfo((prev) => (Object.assign(Object.assign({}, prev), { [newKey.trim()]: parsedValue })));
|
|
18
|
+
setNewKey("");
|
|
19
|
+
setNewValue("");
|
|
20
|
+
};
|
|
21
|
+
const handleRemove = (key) => {
|
|
22
|
+
setExtraInfo((prev) => {
|
|
23
|
+
const updated = Object.assign({}, prev);
|
|
24
|
+
delete updated[key];
|
|
25
|
+
return updated;
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs("div", { className: "mb-6", children: [_jsx("h3", { className: "text-sm font-medium text-gray-700 mb-3", children: "Informations suppl\u00E9mentaires" }), Object.keys(extraInfo).length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mb-3", children: Object.entries(extraInfo).map(([key, value]) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-blue-50 border border-blue-200 rounded-lg text-sm", children: [_jsxs("span", { className: "font-medium text-blue-700", children: [key, ":"] }), _jsx("span", { className: "text-blue-600", children: String(value) }), _jsx("button", { type: "button", onClick: () => handleRemove(key), className: "ml-1 text-blue-400 hover:text-blue-600", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }, key))) })), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { type: "text", value: newKey, onChange: (e) => setNewKey(e.target.value), placeholder: "Cl\u00E9", className: "flex-1 px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" }), _jsxs("select", { value: newValueType, onChange: (e) => setNewValueType(e.target.value), className: "px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500", children: [_jsx("option", { value: "text", children: "Texte" }), _jsx("option", { value: "number", children: "Nombre" }), _jsx("option", { value: "date", children: "Date" }), _jsx("option", { value: "boolean", children: "Oui/Non" })] }), newValueType === "boolean" ? (_jsxs("select", { value: newValue, onChange: (e) => setNewValue(e.target.value), className: "flex-1 px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500", children: [_jsx("option", { value: "", children: "Choisir..." }), _jsx("option", { value: "true", children: "Oui" }), _jsx("option", { value: "false", children: "Non" })] })) : (_jsx("input", { type: newValueType === "date" ? "date" : newValueType, value: newValue, onChange: (e) => setNewValue(e.target.value), placeholder: "Valeur", className: "flex-1 px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" })), _jsx("button", { type: "button", onClick: handleAdd, disabled: !newKey.trim() || !newValue, className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors", children: "OK" })] })] }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=ExtraInfoSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtraInfoSection.js","sourceRoot":"","sources":["../../src/component/ExtraInfoSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASjC,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,YAAY,GACU;IACtB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAY,MAAM,CAAC,CAAC;IACpE,MAAM,CAAC,QAAQ,EAAE,W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iBAAQ,KAAK,EAAC,EAAE,2BAAoB,EACpC,iBAAQ,KAAK,EAAC,MAAM,oBAAa,EACjC,iBAAQ,KAAK,EAAC,OAAO,oBAAa,IAC3B,CACV,CAAC,CAAC,CAAC,CACF,gBACE,IAAI,EAAE,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,EACrD,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,WAAW,EAAC,QAAQ,EACpB,SAAS,EAAC,mHAAmH,GAC7H,CACH,EACD,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EACrC,SAAS,EAAC,sJAAsJ,mBAGzJ,IACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RubricDataValues } from "../util/type";
|
|
2
2
|
type PdfExportModalProps = {
|
|
3
3
|
isOpen: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
|
-
components: Component[];
|
|
6
5
|
dataValues: RubricDataValues;
|
|
7
6
|
title?: string;
|
|
8
7
|
extra?: Record<string, unknown>;
|
|
9
8
|
};
|
|
10
|
-
export declare function PdfExportModal({ isOpen, onClose,
|
|
9
|
+
export declare function PdfExportModal({ isOpen, onClose, dataValues, title, extra, }: PdfExportModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
10
|
export {};
|
|
@@ -1,292 +1,71 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { formatValue, generatePdfHtml, openPdfPrintWindow, } from "../util/pdfExport";
|
|
4
|
+
import { ExtraInfoSection } from "./ExtraInfoSection";
|
|
5
|
+
export function PdfExportModal({ isOpen, onClose, dataValues, title, extra, }) {
|
|
6
|
+
// All attributes selected by default
|
|
5
7
|
const [selectedAttributes, setSelectedAttributes] = useState(() => {
|
|
6
8
|
const initial = {};
|
|
7
|
-
|
|
8
|
-
const compData = dataValues[comp._id];
|
|
9
|
+
for (const [compName, compData] of Object.entries(dataValues)) {
|
|
9
10
|
if (compData) {
|
|
10
|
-
initial[
|
|
11
|
-
Object.keys(compData)
|
|
12
|
-
initial[
|
|
13
|
-
}
|
|
11
|
+
initial[compName] = {};
|
|
12
|
+
for (const attrName of Object.keys(compData)) {
|
|
13
|
+
initial[compName][attrName] = true;
|
|
14
|
+
}
|
|
14
15
|
}
|
|
15
|
-
}
|
|
16
|
+
}
|
|
16
17
|
return initial;
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (compData) {
|
|
26
|
-
if (!updated[comp._id]) {
|
|
27
|
-
updated[comp._id] = {};
|
|
28
|
-
}
|
|
29
|
-
Object.keys(compData).forEach((attrName) => {
|
|
30
|
-
// Only add if not already tracked (preserve user's selection)
|
|
31
|
-
if (updated[comp._id][attrName] === undefined) {
|
|
32
|
-
updated[comp._id][attrName] = true;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return updated;
|
|
38
|
-
});
|
|
39
|
-
}, [components, dataValues]);
|
|
40
|
-
// Get components that have data
|
|
41
|
-
const componentsWithData = useMemo(() => {
|
|
42
|
-
return components.filter((comp) => {
|
|
43
|
-
const data = dataValues[comp._id];
|
|
44
|
-
return data && Object.keys(data).length > 0;
|
|
45
|
-
});
|
|
46
|
-
}, [components, dataValues]);
|
|
47
|
-
// Toggle attribute selection
|
|
48
|
-
const toggleAttribute = (componentId, attributeName) => {
|
|
19
|
+
const [pdfTitle, setPdfTitle] = useState(() => title !== null && title !== void 0 ? title : "");
|
|
20
|
+
const [extraInfo, setExtraInfo] = useState(() => extra !== null && extra !== void 0 ? extra : {});
|
|
21
|
+
// Components that have data (keys are now labels)
|
|
22
|
+
const componentNames = Object.entries(dataValues)
|
|
23
|
+
.filter(([, data]) => data && Object.keys(data).length > 0)
|
|
24
|
+
.map(([name]) => name);
|
|
25
|
+
const toggleAttribute = (compName, attrName) => {
|
|
49
26
|
setSelectedAttributes((prev) => {
|
|
50
27
|
var _a;
|
|
51
|
-
return (Object.assign(Object.assign({}, prev), { [
|
|
28
|
+
return (Object.assign(Object.assign({}, prev), { [compName]: Object.assign(Object.assign({}, prev[compName]), { [attrName]: !((_a = prev[compName]) === null || _a === void 0 ? void 0 : _a[attrName]) }) }));
|
|
52
29
|
});
|
|
53
30
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const compData = dataValues[componentId];
|
|
31
|
+
const toggleAllForComponent = (compName, selected) => {
|
|
32
|
+
const compData = dataValues[compName];
|
|
57
33
|
if (!compData)
|
|
58
34
|
return;
|
|
59
|
-
setSelectedAttributes((prev) => (Object.assign(Object.assign({}, prev), { [
|
|
35
|
+
setSelectedAttributes((prev) => (Object.assign(Object.assign({}, prev), { [compName]: Object.keys(compData).reduce((acc, attrName) => {
|
|
60
36
|
acc[attrName] = selected;
|
|
61
37
|
return acc;
|
|
62
38
|
}, {}) })));
|
|
63
39
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const attr = component.attributes.find((a) => a.name === attrName);
|
|
67
|
-
return (attr === null || attr === void 0 ? void 0 : attr.label) || attrName;
|
|
68
|
-
};
|
|
69
|
-
// Format value for display
|
|
70
|
-
const formatValue = (value) => {
|
|
71
|
-
if (typeof value === "object") {
|
|
72
|
-
if (Array.isArray(value)) {
|
|
73
|
-
return value.join(", ");
|
|
74
|
-
}
|
|
75
|
-
return JSON.stringify(value, null, 2);
|
|
76
|
-
}
|
|
77
|
-
return String(value);
|
|
78
|
-
};
|
|
79
|
-
// Check if all attributes are selected for a component
|
|
80
|
-
const areAllSelected = (componentId) => {
|
|
81
|
-
const compData = dataValues[componentId];
|
|
40
|
+
const areAllSelected = (compName) => {
|
|
41
|
+
const compData = dataValues[compName];
|
|
82
42
|
if (!compData)
|
|
83
43
|
return false;
|
|
84
|
-
return Object.keys(compData).every((attrName) => { var _a; return (_a = selectedAttributes[
|
|
44
|
+
return Object.keys(compData).every((attrName) => { var _a; return (_a = selectedAttributes[compName]) === null || _a === void 0 ? void 0 : _a[attrName]; });
|
|
85
45
|
};
|
|
86
|
-
// Generate PDF content and download
|
|
87
46
|
const handleDownload = () => {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
printWindow.document.write(`
|
|
95
|
-
<!DOCTYPE html>
|
|
96
|
-
<html>
|
|
97
|
-
<head>
|
|
98
|
-
<title>Sauvegarde</title>
|
|
99
|
-
<style>
|
|
100
|
-
* {
|
|
101
|
-
margin: 0;
|
|
102
|
-
padding: 0;
|
|
103
|
-
box-sizing: border-box;
|
|
104
|
-
}
|
|
105
|
-
body {
|
|
106
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
107
|
-
padding: 40px;
|
|
108
|
-
color: #333;
|
|
109
|
-
line-height: 1.6;
|
|
110
|
-
}
|
|
111
|
-
.header {
|
|
112
|
-
text-align: center;
|
|
113
|
-
margin-bottom: 30px;
|
|
114
|
-
padding-bottom: 20px;
|
|
115
|
-
border-bottom: 2px solid #2563eb;
|
|
116
|
-
}
|
|
117
|
-
.header h1 {
|
|
118
|
-
color: #1e40af;
|
|
119
|
-
font-size: 24px;
|
|
120
|
-
margin-bottom: 5px;
|
|
121
|
-
}
|
|
122
|
-
.header p {
|
|
123
|
-
color: #6b7280;
|
|
124
|
-
font-size: 12px;
|
|
125
|
-
}
|
|
126
|
-
.component {
|
|
127
|
-
margin-bottom: 30px;
|
|
128
|
-
page-break-inside: avoid;
|
|
129
|
-
}
|
|
130
|
-
.component-title {
|
|
131
|
-
background: #2563eb;
|
|
132
|
-
color: white;
|
|
133
|
-
padding: 10px 15px;
|
|
134
|
-
font-size: 16px;
|
|
135
|
-
font-weight: 600;
|
|
136
|
-
border-radius: 8px 8px 0 0;
|
|
137
|
-
}
|
|
138
|
-
.component-content {
|
|
139
|
-
border: 1px solid #e5e7eb;
|
|
140
|
-
border-top: none;
|
|
141
|
-
border-radius: 0 0 8px 8px;
|
|
142
|
-
padding: 15px;
|
|
143
|
-
}
|
|
144
|
-
.attribute {
|
|
145
|
-
display: flex;
|
|
146
|
-
padding: 10px 0;
|
|
147
|
-
border-bottom: 1px solid #f3f4f6;
|
|
148
|
-
}
|
|
149
|
-
.attribute:last-child {
|
|
150
|
-
border-bottom: none;
|
|
151
|
-
}
|
|
152
|
-
.attribute-name {
|
|
153
|
-
font-weight: 600;
|
|
154
|
-
color: #374151;
|
|
155
|
-
width: 200px;
|
|
156
|
-
flex-shrink: 0;
|
|
157
|
-
}
|
|
158
|
-
.attribute-value {
|
|
159
|
-
color: #4b5563;
|
|
160
|
-
flex: 1;
|
|
161
|
-
word-break: break-word;
|
|
162
|
-
}
|
|
163
|
-
.extra-info {
|
|
164
|
-
margin-bottom: 30px;
|
|
165
|
-
padding: 15px;
|
|
166
|
-
background: #f9fafb;
|
|
167
|
-
border-radius: 8px;
|
|
168
|
-
border: 1px solid #e5e7eb;
|
|
169
|
-
}
|
|
170
|
-
.extra-item {
|
|
171
|
-
display: inline-block;
|
|
172
|
-
margin-right: 20px;
|
|
173
|
-
margin-bottom: 5px;
|
|
174
|
-
}
|
|
175
|
-
.extra-label {
|
|
176
|
-
font-weight: 600;
|
|
177
|
-
color: #374151;
|
|
178
|
-
}
|
|
179
|
-
.extra-value {
|
|
180
|
-
color: #4b5563;
|
|
181
|
-
margin-left: 5px;
|
|
182
|
-
}
|
|
183
|
-
@media print {
|
|
184
|
-
body { padding: 20px; }
|
|
185
|
-
.component { page-break-inside: avoid; }
|
|
186
|
-
@page {
|
|
187
|
-
margin: 20mm;
|
|
188
|
-
margin-top: 10mm;
|
|
189
|
-
margin-bottom: 10mm;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/* Hide browser headers/footers */
|
|
193
|
-
@page {
|
|
194
|
-
size: auto;
|
|
195
|
-
margin: 10mm;
|
|
196
|
-
}
|
|
197
|
-
</style>
|
|
198
|
-
</head>
|
|
199
|
-
<body>
|
|
200
|
-
${content}
|
|
201
|
-
<script>
|
|
202
|
-
window.onload = function() {
|
|
203
|
-
window.print();
|
|
204
|
-
window.onafterprint = function() {
|
|
205
|
-
window.close();
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
</script>
|
|
209
|
-
</body>
|
|
210
|
-
</html>
|
|
211
|
-
`);
|
|
212
|
-
printWindow.document.close();
|
|
213
|
-
};
|
|
214
|
-
// Generate HTML content for PDF
|
|
215
|
-
const generatePdfContent = () => {
|
|
216
|
-
const date = new Date().toLocaleDateString("fr-FR", {
|
|
217
|
-
year: "numeric",
|
|
218
|
-
month: "long",
|
|
219
|
-
day: "numeric",
|
|
220
|
-
hour: "2-digit",
|
|
221
|
-
minute: "2-digit",
|
|
222
|
-
});
|
|
223
|
-
let html = `
|
|
224
|
-
<div class="header">
|
|
225
|
-
<h1>${title || "Export de Rubrique"}</h1>
|
|
226
|
-
<p>Généré le ${date}</p>
|
|
227
|
-
</div>
|
|
228
|
-
`;
|
|
229
|
-
// Add extra fields if provided
|
|
230
|
-
if (extra && Object.keys(extra).length > 0) {
|
|
231
|
-
html += `
|
|
232
|
-
<div class="extra-info">
|
|
233
|
-
`;
|
|
234
|
-
Object.entries(extra).forEach(([key, value]) => {
|
|
235
|
-
html += `
|
|
236
|
-
<div class="extra-item">
|
|
237
|
-
<span class="extra-label">${key} :</span>
|
|
238
|
-
<span class="extra-value">${String(value)}</span>
|
|
239
|
-
</div>
|
|
240
|
-
`;
|
|
241
|
-
});
|
|
242
|
-
html += `
|
|
243
|
-
</div>
|
|
244
|
-
`;
|
|
245
|
-
}
|
|
246
|
-
componentsWithData.forEach((component) => {
|
|
247
|
-
const compData = dataValues[component._id];
|
|
248
|
-
if (!compData)
|
|
249
|
-
return;
|
|
250
|
-
const selectedAttrs = Object.entries(compData).filter(([attrName]) => { var _a, _b; return (_b = (_a = selectedAttributes[component._id]) === null || _a === void 0 ? void 0 : _a[attrName]) !== null && _b !== void 0 ? _b : true; });
|
|
251
|
-
if (selectedAttrs.length === 0)
|
|
252
|
-
return;
|
|
253
|
-
html += `
|
|
254
|
-
<div class="component">
|
|
255
|
-
<div class="component-title">${component.label || component.name}</div>
|
|
256
|
-
<div class="component-content">
|
|
257
|
-
`;
|
|
258
|
-
selectedAttrs.forEach(([attrName, value]) => {
|
|
259
|
-
const label = getAttributeLabel(component, attrName);
|
|
260
|
-
const formattedValue = formatValue(value);
|
|
261
|
-
html += `
|
|
262
|
-
<div class="attribute">
|
|
263
|
-
<div class="attribute-name">${label}</div>
|
|
264
|
-
<div class="attribute-value">${formattedValue}</div>
|
|
265
|
-
</div>
|
|
266
|
-
`;
|
|
267
|
-
});
|
|
268
|
-
html += `
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
`;
|
|
47
|
+
const html = generatePdfHtml({
|
|
48
|
+
title: pdfTitle,
|
|
49
|
+
extraInfo,
|
|
50
|
+
dataValues,
|
|
51
|
+
selectedAttributes,
|
|
272
52
|
});
|
|
273
|
-
|
|
53
|
+
openPdfPrintWindow(html);
|
|
274
54
|
};
|
|
275
55
|
if (!isOpen)
|
|
276
56
|
return null;
|
|
277
|
-
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [_jsx("div", { className: "absolute inset-0 bg-black/50", onClick: onClose }), _jsxs("div", { className: "relative bg-white rounded-xl shadow-2xl w-full max-w-3xl max-h-[90vh] flex flex-col mx-4", children: [_jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [_jsx("h2", { className: "text-xl font-semibold text-gray-800", children: "Exporter en PDF" }), _jsx("
|
|
278
|
-
const compData = dataValues[
|
|
57
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [_jsx("div", { className: "absolute inset-0 bg-black/50", onClick: onClose }), _jsxs("div", { className: "relative bg-white rounded-xl shadow-2xl w-full max-w-3xl max-h-[90vh] flex flex-col mx-4", children: [_jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [_jsx("h2", { className: "text-xl font-semibold text-gray-800", children: "Exporter en PDF" }), _jsx("button", { type: "button", onClick: onClose, className: "p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-lg transition-colors", children: _jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [_jsxs("div", { className: "mb-6", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Titre du document" }), _jsx("input", { type: "text", value: pdfTitle, onChange: (e) => setPdfTitle(e.target.value), placeholder: "Export de Rubrique", className: "w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" })] }), _jsx(ExtraInfoSection, { extraInfo: extraInfo, setExtraInfo: setExtraInfo }), _jsx("hr", { className: "mb-4 border-gray-200" }), _jsx("p", { className: "text-sm text-gray-600 mb-4", children: "S\u00E9lectionnez les attributs \u00E0 inclure dans le PDF :" }), componentNames.length === 0 ? (_jsx("div", { className: "text-center py-8 text-gray-500", children: "Aucune donn\u00E9e \u00E0 exporter" })) : (_jsx("div", { className: "space-y-6", children: componentNames.map((compName) => {
|
|
58
|
+
const compData = dataValues[compName];
|
|
279
59
|
if (!compData)
|
|
280
60
|
return null;
|
|
281
|
-
const allSelected = areAllSelected(
|
|
282
|
-
return (_jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [_jsxs("div", { className: "bg-gray-50 px-4 py-3 flex items-center justify-between border-b border-gray-200", children: [_jsx("h3", { className: "font-semibold text-gray-800", children:
|
|
61
|
+
const allSelected = areAllSelected(compName);
|
|
62
|
+
return (_jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [_jsxs("div", { className: "bg-gray-50 px-4 py-3 flex items-center justify-between border-b border-gray-200", children: [_jsx("h3", { className: "font-semibold text-gray-800", children: compName }), _jsx("button", { type: "button", onClick: () => toggleAllForComponent(compName, !allSelected), className: "text-sm text-blue-600 hover:text-blue-700 font-medium", children: allSelected
|
|
283
63
|
? "Tout désélectionner"
|
|
284
64
|
: "Tout sélectionner" })] }), _jsx("div", { className: "divide-y divide-gray-100", children: Object.entries(compData).map(([attrName, value]) => {
|
|
285
65
|
var _a, _b;
|
|
286
|
-
const isSelected = (_b = (_a = selectedAttributes[
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}) })] }, component._id));
|
|
66
|
+
const isSelected = (_b = (_a = selectedAttributes[compName]) === null || _a === void 0 ? void 0 : _a[attrName]) !== null && _b !== void 0 ? _b : true;
|
|
67
|
+
return (_jsxs("label", { className: `flex items-start gap-3 px-4 py-3 cursor-pointer hover:bg-gray-50 transition-colors ${!isSelected ? "opacity-50" : ""}`, children: [_jsx("input", { type: "checkbox", checked: isSelected, onChange: () => toggleAttribute(compName, attrName), className: "mt-1 w-4 h-4 text-blue-600 rounded border-gray-300 focus:ring-blue-500" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-medium text-gray-700", children: attrName }), _jsx("div", { className: "text-sm text-gray-500 truncate", children: formatValue(value) })] })] }, attrName));
|
|
68
|
+
}) })] }, compName));
|
|
290
69
|
}) }))] }), _jsxs("div", { className: "px-6 py-4 border-t border-gray-200 bg-gray-50 flex justify-end gap-3", children: [_jsx("button", { type: "button", onClick: onClose, className: "px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors font-medium", children: "Annuler" }), _jsxs("button", { type: "button", onClick: handleDownload, className: "flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium", children: [_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), "T\u00E9l\u00E9charger le PDF"] })] })] })] }));
|
|
291
70
|
}
|
|
292
71
|
//# sourceMappingURL=PdfExportModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfExportModal.js","sourceRoot":"","sources":["../../src/component/PdfExportModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"PdfExportModal.js","sourceRoot":"","sources":["../../src/component/PdfExportModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAYtD,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,KAAK,GACe;IACpB,qCAAqC;IACrC,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAC/C,QAAQ,CAAqB,GAAG,EAAE;QAChC,MAAM,OAAO,GAAuB,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,MAAM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,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,mHAAmH,wBAGtH,EACT,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,cAAc,EACvB,SAAS,EAAC,qHAAqH,aAE/H,cACE,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,YAEnB,eACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,CAAC,EACd,CAAC,EAAC,iIAAiI,GACnI,GACE,oCAEC,IACL,IACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Component, Data,
|
|
1
|
+
import { Component, Data, PermissionType, RubricDataValues, User } from "../util/type";
|
|
2
2
|
type RubricDisplayerProps = {
|
|
3
3
|
components: Component[];
|
|
4
4
|
datas?: (Data | null)[];
|
|
5
|
-
dataValues: RubricDataValues;
|
|
6
|
-
setDataValues: (values: RubricDataValues) => void;
|
|
7
5
|
onSubmit?: (modifiedValues: RubricDataValues) => void;
|
|
8
|
-
|
|
6
|
+
permissions?: PermissionType[];
|
|
7
|
+
users?: User[];
|
|
9
8
|
pdfTitle?: string;
|
|
10
9
|
pdfExtra?: Record<string, unknown>;
|
|
11
10
|
};
|
|
12
|
-
export declare function RubricDisplayer({ components, datas,
|
|
11
|
+
export declare function RubricDisplayer({ components, datas, onSubmit, permissions, users, pdfTitle, pdfExtra, }: RubricDisplayerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
12
|
export {};
|
|
@@ -2,46 +2,35 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useMemo, useEffect } from "react";
|
|
3
3
|
import { ComponentDisplayer } from "./ComponentDisplayer";
|
|
4
4
|
import { PdfExportModal } from "./PdfExportModal";
|
|
5
|
-
import {
|
|
6
|
-
export function RubricDisplayer({ components, datas = [],
|
|
5
|
+
import { groupDataByComponentIndex, extractLatestDataValues, formatDate, getComponentPermission, } from "../util/rubricDisplayer";
|
|
6
|
+
export function RubricDisplayer({ components, datas = [], onSubmit, permissions, users, pdfTitle, pdfExtra, }) {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const [selectedComponentIndex, setSelectedComponentIndex] = useState(0);
|
|
9
9
|
const [selectedHistoryIndex, setSelectedHistoryIndex] = useState({});
|
|
10
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
11
10
|
const [isPdfModalOpen, setIsPdfModalOpen] = useState(false);
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const [pdfDataValues, setPdfDataValues] = useState({});
|
|
12
|
+
// Internal state for form values
|
|
13
|
+
const [dataValues, setDataValues] = useState(() => extractLatestDataValues(components, datas));
|
|
14
|
+
// Store original values for diff comparison
|
|
15
|
+
const [originalValues, setOriginalValues] = useState(() => structuredClone(extractLatestDataValues(components, datas)));
|
|
16
|
+
// Re-initialize when datas changes (e.g. navigating between rubrics)
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (datas.length === 0)
|
|
19
|
+
return;
|
|
20
|
+
const initialValues = extractLatestDataValues(components, datas);
|
|
21
|
+
setDataValues(initialValues);
|
|
22
|
+
setOriginalValues(structuredClone(initialValues));
|
|
23
|
+
}, [datas, components]);
|
|
14
24
|
// Group existing data by component (using index-based mapping)
|
|
15
25
|
// Note: datas may contain null values - index position matters for component mapping
|
|
16
26
|
const componentDataMap = useMemo(() => groupDataByComponentIndex(components, datas), [components, datas]);
|
|
17
|
-
// Initialize dataValues from datas on first render (if datas exist and dataValues is empty)
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const hasValidData = datas.some((d) => d !== null);
|
|
20
|
-
if (!isInitialized && hasValidData && components.length > 0) {
|
|
21
|
-
const hasExistingData = Object.keys(dataValues).length > 0;
|
|
22
|
-
if (!hasExistingData) {
|
|
23
|
-
// Extract latest values from datas and initialize dataValues
|
|
24
|
-
const initialValues = extractLatestDataValues(components, datas);
|
|
25
|
-
if (Object.keys(initialValues).length > 0) {
|
|
26
|
-
setDataValues(initialValues);
|
|
27
|
-
// Store DEEP COPY of original values for later comparison
|
|
28
|
-
setOriginalValues(JSON.parse(JSON.stringify(initialValues)));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// If dataValues already has data, use DEEP COPY as original
|
|
33
|
-
setOriginalValues(JSON.parse(JSON.stringify(dataValues)));
|
|
34
|
-
}
|
|
35
|
-
setIsInitialized(true);
|
|
36
|
-
}
|
|
37
|
-
}, [datas, components, dataValues, setDataValues, isInitialized]);
|
|
38
27
|
// Get current component
|
|
39
28
|
const currentComponent = components[selectedComponentIndex];
|
|
40
29
|
if (!currentComponent)
|
|
41
30
|
return null;
|
|
42
31
|
const currentComponentId = currentComponent._id;
|
|
43
32
|
// Get permission for current component
|
|
44
|
-
const componentPermission = getComponentPermission(
|
|
33
|
+
const componentPermission = getComponentPermission(permissions, currentComponent.name);
|
|
45
34
|
const isDisabled = componentPermission === "read";
|
|
46
35
|
// Get history for current component
|
|
47
36
|
const componentHistory = ((_a = componentDataMap.get(currentComponentId)) === null || _a === void 0 ? void 0 : _a.history) || [];
|
|
@@ -101,9 +90,32 @@ export function RubricDisplayer({ components, datas = [], dataValues, setDataVal
|
|
|
101
90
|
onSubmit(modifiedValues);
|
|
102
91
|
}
|
|
103
92
|
};
|
|
104
|
-
|
|
93
|
+
// Transform dataValues into display-ready format for PDF
|
|
94
|
+
// Component IDs → component labels, attribute names → attribute labels
|
|
95
|
+
const openPdfModal = () => {
|
|
96
|
+
const transformed = {};
|
|
97
|
+
for (const comp of components) {
|
|
98
|
+
const compData = dataValues[comp._id];
|
|
99
|
+
if (!compData || Object.keys(compData).length === 0)
|
|
100
|
+
continue;
|
|
101
|
+
const labeledData = {};
|
|
102
|
+
for (const [attrName, value] of Object.entries(compData)) {
|
|
103
|
+
const attr = comp.attributes.find((a) => a.name === attrName);
|
|
104
|
+
const label = (attr === null || attr === void 0 ? void 0 : attr.label) || attrName;
|
|
105
|
+
labeledData[label] = value;
|
|
106
|
+
}
|
|
107
|
+
transformed[comp.label || comp.name] = labeledData;
|
|
108
|
+
}
|
|
109
|
+
setPdfDataValues(transformed);
|
|
110
|
+
setIsPdfModalOpen(true);
|
|
111
|
+
};
|
|
112
|
+
const userCredentials = (userId) => {
|
|
113
|
+
const user = users === null || users === void 0 ? void 0 : users.find((u) => u.id === userId);
|
|
114
|
+
return user ? `${user.firstName} ${user.lastName}` : "";
|
|
115
|
+
};
|
|
116
|
+
return (_jsxs("div", { className: "w-full", children: [_jsx("div", { className: "flex justify-end mb-4", children: _jsxs("button", { type: "button", onClick: openPdfModal, className: "flex items-center gap-2 px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors font-medium text-sm", children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), "Exporter PDF"] }) }), _jsx("div", { className: "flex flex-wrap gap-2 mb-6 border-b border-gray-200 pb-4", children: components.map((component, index) => {
|
|
105
117
|
var _a;
|
|
106
|
-
const compPermission = getComponentPermission(
|
|
118
|
+
const compPermission = getComponentPermission(permissions, component.name);
|
|
107
119
|
const hasData = (((_a = componentDataMap.get(component._id)) === null || _a === void 0 ? void 0 : _a.history.length) || 0) > 0;
|
|
108
120
|
return (_jsxs("button", { type: "button", onClick: () => setSelectedComponentIndex(index), className: `
|
|
109
121
|
px-4 py-2 rounded-lg font-medium text-sm transition-all
|
|
@@ -135,17 +147,17 @@ export function RubricDisplayer({ components, datas = [], dataValues, setDataVal
|
|
|
135
147
|
: "bg-gray-300 text-gray-700"}
|
|
136
148
|
`, children: componentHistory.length - index }), _jsxs("div", { className: "ml-2", children: [_jsx("div", { className: "font-medium", children: index === 0
|
|
137
149
|
? "Dernière version"
|
|
138
|
-
: `Version ${componentHistory.length - index}` }), _jsx("div", { className: "text-xs text-gray-500", children: formatDate(data.createdAt) })] })] }, data._id || index))) })] })), componentHistory.length === 1 && (_jsxs("div", { className: "mb-4 text-sm text-gray-500 flex items-center gap-2", children: [_jsx("span", { className: "w-2 h-2 bg-blue-500 rounded-full" }), "Derni\u00E8re mise \u00E0 jour : ", formatDate(componentHistory[0].createdAt)] })), componentPermission === "read" && (_jsx("div", { className: "mb-4 px-4 py-2 bg-yellow-50 border border-yellow-200 rounded-lg text-yellow-700 text-sm", children: "Ce composant est en lecture seule. Vous pouvez consulter les donn\u00E9es mais pas les modifier." })), _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: _jsx(ComponentDisplayer, { component: currentComponent, data: getCurrentDataValue(), setData: handleSetData,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
: `Version ${componentHistory.length - index}` }), _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: formatDate(data.createdAt) }), _jsx("div", { className: "text-xs font-medium text-blue-600 mt-0.5", children: userCredentials(data.creator) })] })] }, data._id || index))) })] })), componentHistory.length === 1 && (_jsxs("div", { className: "mb-4 text-sm text-gray-500 flex items-center gap-2", children: [_jsx("span", { className: "w-2 h-2 bg-blue-500 rounded-full" }), "Derni\u00E8re mise \u00E0 jour : ", formatDate(componentHistory[0].createdAt), _jsx("span", { className: "font-medium text-blue-600", children: userCredentials(componentHistory[0].creator) })] })), componentPermission === "read" && (_jsx("div", { className: "mb-4 px-4 py-2 bg-yellow-50 border border-yellow-200 rounded-lg text-yellow-700 text-sm", children: "Ce composant est en lecture seule. Vous pouvez consulter les donn\u00E9es mais pas les modifier." })), _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: _jsx(ComponentDisplayer, { component: currentComponent, data: getCurrentDataValue(), setData: handleSetData, disabled: isDisabled }) }), _jsxs("div", { className: "mt-6 flex items-center justify-between gap-4", children: [_jsx("button", { type: "button", onClick: () => setSelectedComponentIndex((i) => Math.max(0, i - 1)), disabled: selectedComponentIndex === 0, className: "px-4 py-2 rounded-lg text-sm font-medium bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: "\u2190 Pr\u00E9c\u00E9dent" }), _jsx("div", { className: "flex items-center gap-2", children: components.map((comp, index) => {
|
|
151
|
+
const compData = dataValues[comp._id];
|
|
152
|
+
const hasData = compData && Object.keys(compData).length > 0;
|
|
153
|
+
return (_jsx("button", { type: "button", onClick: () => setSelectedComponentIndex(index), className: `
|
|
154
|
+
w-3 h-3 rounded-full transition-all
|
|
155
|
+
${selectedComponentIndex === index
|
|
156
|
+
? "bg-blue-600 scale-125"
|
|
157
|
+
: hasData
|
|
158
|
+
? "bg-blue-300"
|
|
159
|
+
: "bg-gray-300"}
|
|
160
|
+
`, title: comp.label || comp.name }, comp._id));
|
|
161
|
+
}) }), _jsx("button", { type: "button", onClick: () => setSelectedComponentIndex((i) => Math.min(components.length - 1, i + 1)), disabled: selectedComponentIndex === components.length - 1, className: "px-4 py-2 rounded-lg text-sm font-medium bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: "Suivant \u2192" })] }), onSubmit && (_jsx("div", { className: "mt-6 flex justify-center", children: _jsx("button", { type: "button", onClick: handleSubmit, className: "px-8 py-3 bg-blue-600 text-white font-semibold rounded-xl hover:bg-blue-700 active:scale-95 transition-all shadow-md text-sm", children: "Soumettre" }) })), _jsx(PdfExportModal, { isOpen: isPdfModalOpen, onClose: () => setIsPdfModalOpen(false), dataValues: pdfDataValues, title: pdfTitle, extra: pdfExtra })] }));
|
|
150
162
|
}
|
|
151
163
|
//# sourceMappingURL=RubricDisplayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RubricDisplayer.js","sourceRoot":"","sources":["../../src/component/RubricDisplayer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RubricDisplayer.js","sourceRoot":"","sources":["../../src/component/RubricDisplayer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,UAAU,EACV,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAYjC,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,GACa;;IACrB,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxE,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAE9D,EAAE,CAAC,CAAC;IACN,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAmB,EAAE,CAAC,CAAC;IAEzE,iCAAiC;IACjC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAmB,GAAG,EAAE,CAClE,uBAAuB,CAAC,UAAU,EAAE,KAAK,CAAC,CAC3C,CAAC;IAEF,4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AAE,EAAE,CAC9B,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CACvC,EAEH,QAAQ,EAAE,sBAAsB,KAAK,UAAU,CAAC,MAAM,GAAG,CAAC,EAC1D,SAAS,EAAC,wJAAwJ,+BAG3J,IACL,EAGL,QAAQ,IAAI,CACX,cAAK,SAAS,EAAC,0BAA0B,YACvC,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,YAAY,EACrB,SAAS,EAAC,8HAA8H,0BAGjI,GACL,CACP,EAGD,KAAC,cAAc,IACb,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACvC,UAAU,EAAE,aAAa,EACzB,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,GACf,IACE,CACP,CAAC;AACJ,CAAC"}
|
package/dist/index.css
CHANGED
|
@@ -642,6 +642,10 @@ video {
|
|
|
642
642
|
margin-bottom: 0.5rem;
|
|
643
643
|
}
|
|
644
644
|
|
|
645
|
+
.mb-3 {
|
|
646
|
+
margin-bottom: 0.75rem;
|
|
647
|
+
}
|
|
648
|
+
|
|
645
649
|
.mb-4 {
|
|
646
650
|
margin-bottom: 1rem;
|
|
647
651
|
}
|
|
@@ -654,6 +658,10 @@ video {
|
|
|
654
658
|
margin-bottom: 2rem;
|
|
655
659
|
}
|
|
656
660
|
|
|
661
|
+
.ml-1 {
|
|
662
|
+
margin-left: 0.25rem;
|
|
663
|
+
}
|
|
664
|
+
|
|
657
665
|
.ml-2 {
|
|
658
666
|
margin-left: 0.5rem;
|
|
659
667
|
}
|
|
@@ -670,6 +678,14 @@ video {
|
|
|
670
678
|
margin-right: 0.5rem;
|
|
671
679
|
}
|
|
672
680
|
|
|
681
|
+
.mt-0 {
|
|
682
|
+
margin-top: 0px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.mt-0\.5 {
|
|
686
|
+
margin-top: 0.125rem;
|
|
687
|
+
}
|
|
688
|
+
|
|
673
689
|
.mt-1 {
|
|
674
690
|
margin-top: 0.25rem;
|
|
675
691
|
}
|
|
@@ -682,6 +698,10 @@ video {
|
|
|
682
698
|
margin-top: 1rem;
|
|
683
699
|
}
|
|
684
700
|
|
|
701
|
+
.mt-6 {
|
|
702
|
+
margin-top: 1.5rem;
|
|
703
|
+
}
|
|
704
|
+
|
|
685
705
|
.block {
|
|
686
706
|
display: block;
|
|
687
707
|
}
|
|
@@ -837,6 +857,10 @@ video {
|
|
|
837
857
|
gap: 0.75rem;
|
|
838
858
|
}
|
|
839
859
|
|
|
860
|
+
.gap-4 {
|
|
861
|
+
gap: 1rem;
|
|
862
|
+
}
|
|
863
|
+
|
|
840
864
|
.space-y-6 > :not([hidden]) ~ :not([hidden]) {
|
|
841
865
|
--tw-space-y-reverse: 0;
|
|
842
866
|
margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -912,6 +936,11 @@ video {
|
|
|
912
936
|
border-top-width: 1px;
|
|
913
937
|
}
|
|
914
938
|
|
|
939
|
+
.border-blue-200 {
|
|
940
|
+
--tw-border-opacity: 1;
|
|
941
|
+
border-color: rgb(191 219 254 / var(--tw-border-opacity));
|
|
942
|
+
}
|
|
943
|
+
|
|
915
944
|
.border-blue-500 {
|
|
916
945
|
--tw-border-opacity: 1;
|
|
917
946
|
border-color: rgb(59 130 246 / var(--tw-border-opacity));
|
|
@@ -1184,6 +1213,11 @@ video {
|
|
|
1184
1213
|
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
1185
1214
|
}
|
|
1186
1215
|
|
|
1216
|
+
.text-blue-400 {
|
|
1217
|
+
--tw-text-opacity: 1;
|
|
1218
|
+
color: rgb(96 165 250 / var(--tw-text-opacity));
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1187
1221
|
.text-blue-500 {
|
|
1188
1222
|
--tw-text-opacity: 1;
|
|
1189
1223
|
color: rgb(59 130 246 / var(--tw-text-opacity));
|
|
@@ -1329,6 +1363,11 @@ video {
|
|
|
1329
1363
|
--tw-bg-opacity: 1;
|
|
1330
1364
|
}
|
|
1331
1365
|
|
|
1366
|
+
.hover\:text-blue-600:hover {
|
|
1367
|
+
--tw-text-opacity: 1;
|
|
1368
|
+
color: rgb(37 99 235 / var(--tw-text-opacity));
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1332
1371
|
.hover\:text-blue-700:hover {
|
|
1333
1372
|
--tw-text-opacity: 1;
|
|
1334
1373
|
color: rgb(29 78 216 / var(--tw-text-opacity));
|
|
@@ -1353,20 +1392,45 @@ video {
|
|
|
1353
1392
|
outline-offset: 2px;
|
|
1354
1393
|
}
|
|
1355
1394
|
|
|
1395
|
+
.focus\:ring-2:focus {
|
|
1396
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1397
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1398
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1356
1401
|
.focus\:ring-blue-500:focus {
|
|
1357
1402
|
--tw-ring-opacity: 1;
|
|
1358
1403
|
--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
|
|
1359
1404
|
}
|
|
1360
1405
|
|
|
1406
|
+
.active\:scale-95:active {
|
|
1407
|
+
--tw-scale-x: .95;
|
|
1408
|
+
--tw-scale-y: .95;
|
|
1409
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1361
1412
|
.disabled\:pointer-events-none:disabled {
|
|
1362
1413
|
pointer-events: none;
|
|
1363
1414
|
}
|
|
1364
1415
|
|
|
1416
|
+
.disabled\:cursor-not-allowed:disabled {
|
|
1417
|
+
cursor: not-allowed;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
.disabled\:bg-gray-300:disabled {
|
|
1421
|
+
--tw-bg-opacity: 1;
|
|
1422
|
+
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1365
1425
|
.disabled\:bg-gray-400:disabled {
|
|
1366
1426
|
--tw-bg-opacity: 1;
|
|
1367
1427
|
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
|
|
1368
1428
|
}
|
|
1369
1429
|
|
|
1430
|
+
.disabled\:opacity-40:disabled {
|
|
1431
|
+
opacity: 0.4;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1370
1434
|
.disabled\:opacity-50:disabled {
|
|
1371
1435
|
opacity: 0.5;
|
|
1372
1436
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RubricDataValues } from "./type";
|
|
2
|
+
/**
|
|
3
|
+
* Format a value (string or object) for display
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatValue(value: string | object): string;
|
|
6
|
+
type GeneratePdfHtmlParams = {
|
|
7
|
+
title: string;
|
|
8
|
+
extraInfo: Record<string, unknown>;
|
|
9
|
+
dataValues: RubricDataValues;
|
|
10
|
+
selectedAttributes: Record<string, Record<string, boolean>>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Build the full HTML content for the PDF document.
|
|
14
|
+
* dataValues keys are component labels, attribute keys are attribute labels.
|
|
15
|
+
*/
|
|
16
|
+
export declare function generatePdfHtml({ title, extraInfo, dataValues, selectedAttributes, }: GeneratePdfHtmlParams): string;
|
|
17
|
+
/**
|
|
18
|
+
* Open a print window with the generated HTML and trigger browser print dialog
|
|
19
|
+
*/
|
|
20
|
+
export declare function openPdfPrintWindow(htmlContent: string): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a value (string or object) for display
|
|
3
|
+
*/
|
|
4
|
+
export function formatValue(value) {
|
|
5
|
+
if (typeof value === "object") {
|
|
6
|
+
if (Array.isArray(value)) {
|
|
7
|
+
return value.join(", ");
|
|
8
|
+
}
|
|
9
|
+
return JSON.stringify(value, null, 2);
|
|
10
|
+
}
|
|
11
|
+
return String(value);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Build the full HTML content for the PDF document.
|
|
15
|
+
* dataValues keys are component labels, attribute keys are attribute labels.
|
|
16
|
+
*/
|
|
17
|
+
export function generatePdfHtml({ title, extraInfo, dataValues, selectedAttributes, }) {
|
|
18
|
+
const date = new Date().toLocaleDateString("fr-FR", {
|
|
19
|
+
year: "numeric",
|
|
20
|
+
month: "long",
|
|
21
|
+
day: "numeric",
|
|
22
|
+
hour: "2-digit",
|
|
23
|
+
minute: "2-digit",
|
|
24
|
+
});
|
|
25
|
+
let html = `
|
|
26
|
+
<div class="header">
|
|
27
|
+
<h1>${title || "Export de Rubrique"}</h1>
|
|
28
|
+
<p>Généré le ${date}</p>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
// Extra fields
|
|
32
|
+
if (Object.keys(extraInfo).length > 0) {
|
|
33
|
+
html += `<div class="extra-info">`;
|
|
34
|
+
Object.entries(extraInfo).forEach(([key, value]) => {
|
|
35
|
+
html += `
|
|
36
|
+
<div class="extra-item">
|
|
37
|
+
<span class="extra-label">${key} :</span>
|
|
38
|
+
<span class="extra-value">${String(value)}</span>
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
});
|
|
42
|
+
html += `</div>`;
|
|
43
|
+
}
|
|
44
|
+
// Iterate over components (keys are labels)
|
|
45
|
+
Object.entries(dataValues).forEach(([compName, compData]) => {
|
|
46
|
+
if (!compData || Object.keys(compData).length === 0)
|
|
47
|
+
return;
|
|
48
|
+
const selectedAttrs = Object.entries(compData).filter(([attrName]) => { var _a, _b; return (_b = (_a = selectedAttributes[compName]) === null || _a === void 0 ? void 0 : _a[attrName]) !== null && _b !== void 0 ? _b : true; });
|
|
49
|
+
if (selectedAttrs.length === 0)
|
|
50
|
+
return;
|
|
51
|
+
html += `
|
|
52
|
+
<div class="component">
|
|
53
|
+
<div class="component-title">${compName}</div>
|
|
54
|
+
<div class="component-content">
|
|
55
|
+
`;
|
|
56
|
+
selectedAttrs.forEach(([attrName, value]) => {
|
|
57
|
+
html += `
|
|
58
|
+
<div class="attribute">
|
|
59
|
+
<div class="attribute-name">${attrName}</div>
|
|
60
|
+
<div class="attribute-value">${formatValue(value)}</div>
|
|
61
|
+
</div>
|
|
62
|
+
`;
|
|
63
|
+
});
|
|
64
|
+
html += `
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
`;
|
|
68
|
+
});
|
|
69
|
+
return html;
|
|
70
|
+
}
|
|
71
|
+
const PDF_STYLES = `
|
|
72
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
73
|
+
body {
|
|
74
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
75
|
+
padding: 40px;
|
|
76
|
+
color: #333;
|
|
77
|
+
line-height: 1.6;
|
|
78
|
+
}
|
|
79
|
+
.header {
|
|
80
|
+
text-align: center;
|
|
81
|
+
margin-bottom: 30px;
|
|
82
|
+
padding-bottom: 20px;
|
|
83
|
+
border-bottom: 2px solid #2563eb;
|
|
84
|
+
}
|
|
85
|
+
.header h1 { color: #1e40af; font-size: 24px; margin-bottom: 5px; }
|
|
86
|
+
.header p { color: #6b7280; font-size: 12px; }
|
|
87
|
+
.component { margin-bottom: 30px; page-break-inside: avoid; }
|
|
88
|
+
.component-title {
|
|
89
|
+
background: #2563eb;
|
|
90
|
+
color: white;
|
|
91
|
+
padding: 10px 15px;
|
|
92
|
+
font-size: 16px;
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
border-radius: 8px 8px 0 0;
|
|
95
|
+
}
|
|
96
|
+
.component-content {
|
|
97
|
+
border: 1px solid #e5e7eb;
|
|
98
|
+
border-top: none;
|
|
99
|
+
border-radius: 0 0 8px 8px;
|
|
100
|
+
padding: 15px;
|
|
101
|
+
}
|
|
102
|
+
.attribute {
|
|
103
|
+
display: flex;
|
|
104
|
+
padding: 10px 0;
|
|
105
|
+
border-bottom: 1px solid #f3f4f6;
|
|
106
|
+
}
|
|
107
|
+
.attribute:last-child { border-bottom: none; }
|
|
108
|
+
.attribute-name {
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
color: #374151;
|
|
111
|
+
width: 200px;
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
}
|
|
114
|
+
.attribute-value {
|
|
115
|
+
color: #4b5563;
|
|
116
|
+
flex: 1;
|
|
117
|
+
word-break: break-word;
|
|
118
|
+
}
|
|
119
|
+
.extra-info {
|
|
120
|
+
margin-bottom: 30px;
|
|
121
|
+
padding: 15px;
|
|
122
|
+
background: #f9fafb;
|
|
123
|
+
border-radius: 8px;
|
|
124
|
+
border: 1px solid #e5e7eb;
|
|
125
|
+
}
|
|
126
|
+
.extra-item { display: inline-block; margin-right: 20px; margin-bottom: 5px; }
|
|
127
|
+
.extra-label { font-weight: 600; color: #374151; }
|
|
128
|
+
.extra-value { color: #4b5563; margin-left: 5px; }
|
|
129
|
+
@media print {
|
|
130
|
+
body { padding: 20px; }
|
|
131
|
+
.component { page-break-inside: avoid; }
|
|
132
|
+
@page { margin: 20mm; margin-top: 10mm; margin-bottom: 10mm; }
|
|
133
|
+
}
|
|
134
|
+
@page { size: auto; margin: 10mm; }
|
|
135
|
+
`;
|
|
136
|
+
/**
|
|
137
|
+
* Open a print window with the generated HTML and trigger browser print dialog
|
|
138
|
+
*/
|
|
139
|
+
export function openPdfPrintWindow(htmlContent) {
|
|
140
|
+
const printWindow = window.open("", "_blank");
|
|
141
|
+
if (!printWindow) {
|
|
142
|
+
alert("Veuillez autoriser les popups pour télécharger le PDF");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
printWindow.document.write(`
|
|
146
|
+
<!DOCTYPE html>
|
|
147
|
+
<html>
|
|
148
|
+
<head>
|
|
149
|
+
<title>Sauvegarde</title>
|
|
150
|
+
<style>${PDF_STYLES}</style>
|
|
151
|
+
</head>
|
|
152
|
+
<body>
|
|
153
|
+
${htmlContent}
|
|
154
|
+
<script>
|
|
155
|
+
window.onload = function() {
|
|
156
|
+
window.print();
|
|
157
|
+
window.onafterprint = function() { window.close(); };
|
|
158
|
+
};
|
|
159
|
+
</script>
|
|
160
|
+
</body>
|
|
161
|
+
</html>
|
|
162
|
+
`);
|
|
163
|
+
printWindow.document.close();
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=pdfExport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdfExport.js","sourceRoot":"","sources":["../../src/util/pdfExport.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAsB;IAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AASD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,SAAS,EACT,UAAU,EACV,kBAAkB,GACI;IACtB,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE;QAClD,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,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AC,CAAC;QAEH,IAAI,IAAI;;;KAGP,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgElB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;;;;;iBAKZ,UAAU;;;UAGjB,WAAW;;;;;;;;;GASlB,CAAC,CAAC;IACH,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Component, Data,
|
|
1
|
+
import { Component, Data, ComponentDataHistory, RubricDataValues, PermissionType } from "./type";
|
|
2
2
|
/**
|
|
3
3
|
* Get permission level for a specific component
|
|
4
4
|
*/
|
|
5
|
-
export declare function getComponentPermission(
|
|
5
|
+
export declare function getComponentPermission(permissions: PermissionType[] | undefined, componentName: string): "read" | "write" | null;
|
|
6
6
|
/**
|
|
7
7
|
* Check if user can edit a component (has write permission)
|
|
8
8
|
*/
|
|
9
|
-
export declare function canEditComponent(permission:
|
|
9
|
+
export declare function canEditComponent(permission: PermissionType[] | undefined, componentName: string): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Groups data by component using INDEX-BASED mapping for first N items,
|
|
12
12
|
* then COMPONENT ID matching for historical items.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Get permission level for a specific component
|
|
3
3
|
*/
|
|
4
|
-
export function getComponentPermission(
|
|
5
|
-
if (!
|
|
4
|
+
export function getComponentPermission(permissions, componentName) {
|
|
5
|
+
if (!permissions || !permissions.length)
|
|
6
6
|
return null;
|
|
7
|
-
const perm =
|
|
7
|
+
const perm = permissions.find((p) => p.component === componentName);
|
|
8
8
|
return (perm === null || perm === void 0 ? void 0 : perm.permission) || null;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rubricDisplayer.js","sourceRoot":"","sources":["../../src/util/rubricDisplayer.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,
|
|
1
|
+
{"version":3,"file":"rubricDisplayer.js","sourceRoot":"","sources":["../../src/util/rubricDisplayer.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,WAAyC,EACzC,aAAqB;IAErB,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACrD,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,aAAa,CAAC,CAAC;IACpE,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,KAAI,IAAI,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAwC,EACxC,aAAqB;IAErB,OAAO,sBAAsB,CAAC,UAAU,EAAE,aAAa,CAAC,KAAK,OAAO,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAAuB,EACvB,KAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAgC,CAAC;IACvD,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAEzC,+CAA+C;IAC/C,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QAC/B,MAA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ts
CHANGED
|
@@ -82,6 +82,7 @@ export interface ComponentResult {
|
|
|
82
82
|
export interface Data<TComponent = string | Component> {
|
|
83
83
|
_id: string;
|
|
84
84
|
proprietor: string;
|
|
85
|
+
creator: string;
|
|
85
86
|
from: string;
|
|
86
87
|
component: TComponent;
|
|
87
88
|
value: DataJSON;
|
|
@@ -124,4 +125,10 @@ export interface ComponentDataHistory {
|
|
|
124
125
|
currentData: Data | null;
|
|
125
126
|
history: Data[];
|
|
126
127
|
}
|
|
128
|
+
export interface User {
|
|
129
|
+
id: string;
|
|
130
|
+
email?: string;
|
|
131
|
+
firstName?: string;
|
|
132
|
+
lastName?: string;
|
|
133
|
+
}
|
|
127
134
|
export type RubricDataValues = Record<string, DataJSON>;
|
package/dist/util/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/util/type.ts"],"names":[],"mappings":"AAIA,QAAQ;AACR,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,6BAAY,CAAA;IACZ,iCAAgB,CAAA;IAChB,iCAAgB,CAAA;IAChB,oCAAmB,CAAA;AACrB,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,iBAiBX;AAjBD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,oCAAe,CAAA;IACf,kCAAa,CAAA;IACb,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,oCAAe,CAAA;IACf,gDAA2B,CAAA;IAC3B,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;IAC7B,oDAA+B,CAAA;AACjC,CAAC,EAjBW,iBAAiB,KAAjB,iBAAiB,QAiB5B;AAED,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,oC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