@sd-angular/core 1.3.239 → 1.3.240
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/bundles/sd-angular-core-export.umd.js +95 -88
- package/bundles/sd-angular-core-export.umd.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.min.js +1 -1
- package/bundles/sd-angular-core-export.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-table.umd.js +513 -89
- package/bundles/sd-angular-core-table.umd.js.map +1 -1
- package/bundles/sd-angular-core-table.umd.min.js +2 -2
- package/bundles/sd-angular-core-table.umd.min.js.map +1 -1
- package/esm2015/export/src/lib/export.service.js +93 -90
- package/esm2015/table/sd-angular-core-table.js +19 -18
- package/esm2015/table/src/lib/components/popup-export/popup-export.component.js +289 -0
- package/esm2015/table/src/lib/models/table-option-export.model.js +1 -1
- package/esm2015/table/src/lib/table.component.js +32 -16
- package/esm2015/table/src/lib/table.module.js +5 -1
- package/export/src/lib/export.service.d.ts +4 -0
- package/fesm2015/sd-angular-core-export.js +92 -89
- package/fesm2015/sd-angular-core-export.js.map +1 -1
- package/fesm2015/sd-angular-core-table.js +318 -17
- package/fesm2015/sd-angular-core-table.js.map +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.239.tgz → sd-angular-core-1.3.240.tgz} +0 -0
- package/table/sd-angular-core-table.d.ts +18 -17
- package/table/sd-angular-core-table.metadata.json +1 -1
- package/table/src/lib/components/popup-export/popup-export.component.d.ts +56 -0
- package/table/src/lib/models/table-option-export.model.d.ts +7 -6
- package/table/src/lib/table.component.d.ts +8 -1
|
@@ -346,12 +346,12 @@
|
|
|
346
346
|
border: {
|
|
347
347
|
bottom: { style: 'thin' },
|
|
348
348
|
left: { style: 'thin' },
|
|
349
|
-
right: { style: 'thin' }
|
|
349
|
+
right: { style: 'thin' },
|
|
350
350
|
},
|
|
351
351
|
alignment: {
|
|
352
352
|
vertical: 'middle',
|
|
353
353
|
horizontal: 'center',
|
|
354
|
-
wrapText: true
|
|
354
|
+
wrapText: true,
|
|
355
355
|
},
|
|
356
356
|
font: {
|
|
357
357
|
bold: true,
|
|
@@ -362,9 +362,9 @@
|
|
|
362
362
|
type: 'pattern',
|
|
363
363
|
pattern: 'solid',
|
|
364
364
|
fgColor: {
|
|
365
|
-
argb: 'FAFAFA'
|
|
366
|
-
}
|
|
367
|
-
}
|
|
365
|
+
argb: 'FAFAFA',
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
368
|
});
|
|
369
369
|
_titleColor.set(this, 'FFFFFF');
|
|
370
370
|
_titleFgColor.set(this, '143180');
|
|
@@ -372,12 +372,12 @@
|
|
|
372
372
|
border: {
|
|
373
373
|
bottom: { style: 'thin' },
|
|
374
374
|
left: { style: 'thin' },
|
|
375
|
-
right: { style: 'thin' }
|
|
375
|
+
right: { style: 'thin' },
|
|
376
376
|
},
|
|
377
377
|
alignment: {
|
|
378
378
|
vertical: 'middle',
|
|
379
379
|
horizontal: 'center',
|
|
380
|
-
wrapText: true
|
|
380
|
+
wrapText: true,
|
|
381
381
|
},
|
|
382
382
|
font: {
|
|
383
383
|
bold: true,
|
|
@@ -389,19 +389,19 @@
|
|
|
389
389
|
pattern: 'solid',
|
|
390
390
|
fgColor: {
|
|
391
391
|
argb: __classPrivateFieldGet(this, _titleFgColor),
|
|
392
|
-
}
|
|
393
|
-
}
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
394
|
});
|
|
395
395
|
_requiredStyle.set(this, {
|
|
396
396
|
border: {
|
|
397
397
|
bottom: { style: 'thin' },
|
|
398
398
|
left: { style: 'thin' },
|
|
399
|
-
right: { style: 'thin' }
|
|
399
|
+
right: { style: 'thin' },
|
|
400
400
|
},
|
|
401
401
|
alignment: {
|
|
402
402
|
vertical: 'middle',
|
|
403
403
|
horizontal: 'center',
|
|
404
|
-
wrapText: true
|
|
404
|
+
wrapText: true,
|
|
405
405
|
},
|
|
406
406
|
font: {
|
|
407
407
|
italic: true,
|
|
@@ -412,18 +412,18 @@
|
|
|
412
412
|
type: 'pattern',
|
|
413
413
|
pattern: 'solid',
|
|
414
414
|
fgColor: {
|
|
415
|
-
argb: 'FF1744'
|
|
416
|
-
}
|
|
417
|
-
}
|
|
415
|
+
argb: 'FF1744',
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
418
|
});
|
|
419
419
|
_descriptionStyle.set(this, {
|
|
420
420
|
border: {
|
|
421
421
|
bottom: { style: 'thin' },
|
|
422
422
|
left: { style: 'thin' },
|
|
423
|
-
right: { style: 'thin' }
|
|
423
|
+
right: { style: 'thin' },
|
|
424
424
|
},
|
|
425
425
|
alignment: {
|
|
426
|
-
wrapText: true
|
|
426
|
+
wrapText: true,
|
|
427
427
|
},
|
|
428
428
|
font: {
|
|
429
429
|
italic: true,
|
|
@@ -434,27 +434,27 @@
|
|
|
434
434
|
type: 'pattern',
|
|
435
435
|
pattern: 'solid',
|
|
436
436
|
fgColor: {
|
|
437
|
-
argb: 'CFD8DC'
|
|
438
|
-
}
|
|
439
|
-
}
|
|
437
|
+
argb: 'CFD8DC',
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
440
|
});
|
|
441
441
|
_cellStyle.set(this, {
|
|
442
442
|
alignment: {
|
|
443
443
|
vertical: 'middle',
|
|
444
|
-
wrapText: true
|
|
445
|
-
}
|
|
444
|
+
wrapText: true,
|
|
445
|
+
},
|
|
446
446
|
});
|
|
447
447
|
_directory.set(this, function (key, group) {
|
|
448
448
|
var hashedFolder = hash__default['default']({
|
|
449
449
|
folder: _this.folder,
|
|
450
|
-
userFolder: _this.userFolder
|
|
450
|
+
userFolder: _this.userFolder,
|
|
451
451
|
});
|
|
452
452
|
if (!group) {
|
|
453
453
|
return "dir1=" + _this.folder + "&dir2=U-" + hashedFolder + "&dir3=" + (key || '');
|
|
454
454
|
}
|
|
455
455
|
hashedFolder = hash__default['default']({
|
|
456
456
|
folder: _this.folder,
|
|
457
|
-
group: group
|
|
457
|
+
group: group,
|
|
458
458
|
});
|
|
459
459
|
return "dir1=" + _this.folder + "&dir2=G-" + hashedFolder + "&dir3=" + (key || '');
|
|
460
460
|
});
|
|
@@ -512,8 +512,8 @@
|
|
|
512
512
|
type: 'pattern',
|
|
513
513
|
pattern: 'solid',
|
|
514
514
|
fgColor: {
|
|
515
|
-
argb: fill || __classPrivateFieldGet(_this, _titleFgColor)
|
|
516
|
-
}
|
|
515
|
+
argb: fill || __classPrivateFieldGet(_this, _titleFgColor),
|
|
516
|
+
},
|
|
517
517
|
} });
|
|
518
518
|
cellField.value = column.field;
|
|
519
519
|
cellTitle.value = column.title;
|
|
@@ -573,7 +573,7 @@
|
|
|
573
573
|
return [4 /*yield*/, SdUtility.upload({
|
|
574
574
|
extensions: ['xlsx'],
|
|
575
575
|
maxSizeInMb: 0.1,
|
|
576
|
-
validator: validator
|
|
576
|
+
validator: validator,
|
|
577
577
|
})];
|
|
578
578
|
case 1:
|
|
579
579
|
file = _h.sent();
|
|
@@ -633,10 +633,10 @@
|
|
|
633
633
|
return [4 /*yield*/, this.apiService.get(url)];
|
|
634
634
|
case 1:
|
|
635
635
|
res = _g.sent();
|
|
636
|
-
return [2 /*return*/, ((_a = res.files) === null || _a === void 0 ? void 0 : _a.map(function (e) { return ({
|
|
636
|
+
return [2 /*return*/, (((_a = res.files) === null || _a === void 0 ? void 0 : _a.map(function (e) { return ({
|
|
637
637
|
filePath: e.publicUrl,
|
|
638
|
-
fileName: e.name
|
|
639
|
-
}); })) || []];
|
|
638
|
+
fileName: e.name,
|
|
639
|
+
}); })) || [])];
|
|
640
640
|
}
|
|
641
641
|
});
|
|
642
642
|
}); };
|
|
@@ -660,9 +660,9 @@
|
|
|
660
660
|
filePath: filePath,
|
|
661
661
|
columns: columns,
|
|
662
662
|
items: items,
|
|
663
|
-
fileName: fileName
|
|
663
|
+
fileName: fileName,
|
|
664
664
|
}, null, {
|
|
665
|
-
responseType: 'arraybuffer'
|
|
665
|
+
responseType: 'arraybuffer',
|
|
666
666
|
})];
|
|
667
667
|
case 1:
|
|
668
668
|
buffer = _g.sent();
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
fromRow = hasDescription ? 4 : 3;
|
|
792
792
|
items.forEach(function (e, idx1) {
|
|
793
793
|
columns.forEach(function (column, idx2) {
|
|
794
|
-
if (typeof
|
|
794
|
+
if (typeof e[column.field] === 'number') {
|
|
795
795
|
firstSheet.getCell(fromRow + idx1, 1 + idx2).value = +e[column.field];
|
|
796
796
|
firstSheet.getCell(fromRow + idx1, 1 + idx2).numFmt = '#';
|
|
797
797
|
}
|
|
@@ -827,7 +827,7 @@
|
|
|
827
827
|
name = sheet.name, columns = sheet.columns, cells = sheet.cells;
|
|
828
828
|
worksheet = workbook.addWorksheet(name || "Sheet " + (idx + 1));
|
|
829
829
|
try {
|
|
830
|
-
for (_k = (e_7 = void 0, __values(
|
|
830
|
+
for (_k = (e_7 = void 0, __values(columns || [])), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
831
831
|
column = _l.value;
|
|
832
832
|
worksheet.getColumn(column.index).style = column.style;
|
|
833
833
|
worksheet.getColumn(column.index).width = column.width;
|
|
@@ -880,9 +880,9 @@
|
|
|
880
880
|
sdMergePDF = API.sdMergePDF;
|
|
881
881
|
url = "" + this.functionUrl + sdMergePDF;
|
|
882
882
|
return [4 /*yield*/, this.apiService.post(url, {
|
|
883
|
-
urls: urls
|
|
883
|
+
urls: urls,
|
|
884
884
|
}, null, {
|
|
885
|
-
responseType: 'arraybuffer'
|
|
885
|
+
responseType: 'arraybuffer',
|
|
886
886
|
})];
|
|
887
887
|
case 1:
|
|
888
888
|
buffer = _g.sent();
|
|
@@ -892,70 +892,77 @@
|
|
|
892
892
|
});
|
|
893
893
|
}); };
|
|
894
894
|
this.uploadXlsx = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
895
|
+
var _this = this;
|
|
895
896
|
return __generator(this, function (_g) {
|
|
896
897
|
switch (_g.label) {
|
|
897
898
|
case 0: return [4 /*yield*/, SdUtility.upload({
|
|
898
899
|
extensions: ['xlsx'],
|
|
899
900
|
maxSizeInMb: 10,
|
|
900
901
|
}).then(function (file) {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
902
|
+
return _this.parseXlsx(file);
|
|
903
|
+
})];
|
|
904
|
+
case 1: return [2 /*return*/, _g.sent()];
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
}); };
|
|
908
|
+
this.parseXlsx = function (file) { return __awaiter(_this, void 0, void 0, function () {
|
|
909
|
+
return __generator(this, function (_g) {
|
|
910
|
+
if (file) {
|
|
911
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
912
|
+
var wb = new exceljs.Workbook();
|
|
913
|
+
var reader = new FileReader();
|
|
914
|
+
reader.onload = function () {
|
|
915
|
+
var buffer = reader.result;
|
|
916
|
+
if (!buffer) {
|
|
917
|
+
reject('Có lỗi xảy ra khi đọc file');
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
wb.xlsx.load(buffer).then(function (workbook) {
|
|
921
|
+
var sheet = workbook.worksheets[0];
|
|
922
|
+
if (!sheet) {
|
|
923
|
+
reject('Không tìm thấy dữ liệu');
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
var items = [];
|
|
927
|
+
var headers = sheet.getRow(1).values;
|
|
928
|
+
if (Array.isArray(headers)) {
|
|
929
|
+
sheet.eachRow(function (row, rowIndex) {
|
|
930
|
+
var hasValues = row.hasValues, values = row.values;
|
|
931
|
+
// console.log(row, hasValues, values)
|
|
932
|
+
if (hasValues && rowIndex > 1) {
|
|
933
|
+
var item_1 = {};
|
|
934
|
+
headers.forEach(function (cellValue, index) {
|
|
935
|
+
if (cellValue) {
|
|
936
|
+
var field = cellValue.toString();
|
|
937
|
+
item_1[field] = values[index];
|
|
938
|
+
if (typeof item_1[field] === 'string') {
|
|
939
|
+
item_1[field] = item_1[field].trim();
|
|
940
|
+
}
|
|
941
|
+
if (item_1[field] === '' || item_1[field] === undefined) {
|
|
942
|
+
item_1[field] = null;
|
|
943
|
+
}
|
|
938
944
|
}
|
|
939
945
|
});
|
|
940
|
-
|
|
941
|
-
items: items,
|
|
942
|
-
file: file
|
|
943
|
-
});
|
|
946
|
+
items.push(item_1);
|
|
944
947
|
}
|
|
945
948
|
});
|
|
946
|
-
|
|
947
|
-
|
|
949
|
+
resolve({
|
|
950
|
+
items: items,
|
|
951
|
+
file: file,
|
|
952
|
+
});
|
|
953
|
+
}
|
|
948
954
|
});
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
return {
|
|
952
|
-
items: [],
|
|
953
|
-
file: null
|
|
954
|
-
};
|
|
955
|
-
}
|
|
955
|
+
};
|
|
956
|
+
reader.readAsArrayBuffer(file);
|
|
956
957
|
})];
|
|
957
|
-
case 1: return [2 /*return*/, _g.sent()];
|
|
958
958
|
}
|
|
959
|
+
else {
|
|
960
|
+
return [2 /*return*/, {
|
|
961
|
+
items: [],
|
|
962
|
+
file: null,
|
|
963
|
+
}];
|
|
964
|
+
}
|
|
965
|
+
return [2 /*return*/];
|
|
959
966
|
});
|
|
960
967
|
}); };
|
|
961
968
|
}
|
|
@@ -981,7 +988,7 @@
|
|
|
981
988
|
if (!folder) {
|
|
982
989
|
return;
|
|
983
990
|
}
|
|
984
|
-
if (typeof
|
|
991
|
+
if (typeof folder === 'string') {
|
|
985
992
|
return folder;
|
|
986
993
|
}
|
|
987
994
|
return folder();
|
|
@@ -995,7 +1002,7 @@
|
|
|
995
1002
|
SdExportService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SdExportService_Factory() { return new SdExportService(i0.ɵɵinject(i1.SdApiService), i0.ɵɵinject(i2.SdNotifyService), i0.ɵɵinject(i3.FIREBASE_CONFIG, 8)); }, token: SdExportService, providedIn: "root" });
|
|
996
1003
|
SdExportService.decorators = [
|
|
997
1004
|
{ type: i0.Injectable, args: [{
|
|
998
|
-
providedIn: 'root'
|
|
1005
|
+
providedIn: 'root',
|
|
999
1006
|
},] }
|
|
1000
1007
|
];
|
|
1001
1008
|
SdExportService.ctorParameters = function () { return [
|