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.
@@ -21,6 +21,7 @@ export interface IExcelJsCell {
21
21
  v: ExcelJS.CellValue;
22
22
  t?: string;
23
23
  z?: string;
24
+ hyperlink?: string;
24
25
  s?: {
25
26
  font?: Partial<ExcelJS.Font>;
26
27
  alignment?: Partial<ExcelJS.Alignment>;
@@ -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) {
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.4.56",
3
+ "version": "1.4.58",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {