gemcap-be-common 1.4.56 → 1.4.58
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/helpers/excel.helper.d.ts +1 -0
- package/helpers/excel.helper.js +11 -0
- package/helpers/excel.helper.ts +13 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/helpers/excel.helper.js
CHANGED
|
@@ -160,6 +160,17 @@ const convertDataToFileWithStyle = async (dataToConvert, options) => {
|
|
|
160
160
|
if (cell.t === 'n') {
|
|
161
161
|
excelCell.numFmt = cell.z || '#,##0.00';
|
|
162
162
|
}
|
|
163
|
+
if (cell.hyperlink) {
|
|
164
|
+
excelCell.value = {
|
|
165
|
+
text: cell.v?.toString() ?? '',
|
|
166
|
+
hyperlink: cell.hyperlink,
|
|
167
|
+
};
|
|
168
|
+
// (Необязательно) стиль как ссылка
|
|
169
|
+
excelCell.font = { color: { argb: '0563C1' }, underline: true };
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
excelCell.value = cell.v;
|
|
173
|
+
}
|
|
163
174
|
// STYLES
|
|
164
175
|
if (cell.s) {
|
|
165
176
|
if (cell.s.font) {
|
package/helpers/excel.helper.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface IExcelJsCell {
|
|
|
25
25
|
v: ExcelJS.CellValue;
|
|
26
26
|
t?: string;
|
|
27
27
|
z?: string;
|
|
28
|
+
hyperlink?: string;
|
|
28
29
|
s?: {
|
|
29
30
|
font?: Partial<ExcelJS.Font>;
|
|
30
31
|
alignment?: Partial<ExcelJS.Alignment>;
|
|
@@ -188,6 +189,18 @@ export const convertDataToFileWithStyle = async (
|
|
|
188
189
|
excelCell.numFmt = cell.z || '#,##0.00';
|
|
189
190
|
}
|
|
190
191
|
|
|
192
|
+
if (cell.hyperlink) {
|
|
193
|
+
excelCell.value = {
|
|
194
|
+
text: cell.v?.toString() ?? '',
|
|
195
|
+
hyperlink: cell.hyperlink,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// (Необязательно) стиль как ссылка
|
|
199
|
+
excelCell.font = { color: { argb: '0563C1' }, underline: true };
|
|
200
|
+
} else {
|
|
201
|
+
excelCell.value = cell.v;
|
|
202
|
+
}
|
|
203
|
+
|
|
191
204
|
// STYLES
|
|
192
205
|
if (cell.s) {
|
|
193
206
|
if (cell.s.font) {
|