@sd-angular/core 1.2.22 → 1.2.25
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-common.umd.js +21 -2
- package/bundles/sd-angular-core-common.umd.js.map +1 -1
- package/bundles/sd-angular-core-common.umd.min.js +1 -1
- package/bundles/sd-angular-core-common.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-input.umd.js +2 -1
- package/bundles/sd-angular-core-input.umd.js.map +1 -1
- package/bundles/sd-angular-core-input.umd.min.js +1 -1
- package/bundles/sd-angular-core-input.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.js +125 -53
- package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.min.js +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.min.js.map +1 -1
- package/common/sd-angular-core-common.metadata.json +1 -1
- package/common/src/lib/directives/sd-lable.directive.d.ts +5 -0
- package/common/src/public-api.d.ts +1 -0
- package/esm2015/common/src/lib/common.module.js +6 -3
- package/esm2015/common/src/lib/directives/sd-lable.directive.js +16 -0
- package/esm2015/common/src/public-api.js +2 -1
- package/esm2015/grid-material/src/lib/models/grid-export.model.js +1 -1
- package/esm2015/input/src/lib/input.component.js +4 -3
- package/esm2015/upload-excel/sd-angular-core-upload-excel.js +3 -1
- package/esm2015/upload-excel/src/lib/pipes/columm-hidden.pipe.js +23 -0
- package/esm2015/upload-excel/src/lib/pipes/column-transform.pipe.js +18 -0
- package/esm2015/upload-excel/src/lib/upload-excel.component.js +29 -11
- package/esm2015/upload-excel/src/lib/upload-excel.model.js +1 -1
- package/esm2015/upload-excel/src/lib/upload-excel.module.js +7 -2
- package/fesm2015/sd-angular-core-common.js +20 -3
- package/fesm2015/sd-angular-core-common.js.map +1 -1
- package/fesm2015/sd-angular-core-input.js +3 -2
- package/fesm2015/sd-angular-core-input.js.map +1 -1
- package/fesm2015/sd-angular-core-upload-excel.js +71 -13
- package/fesm2015/sd-angular-core-upload-excel.js.map +1 -1
- package/grid-material/src/lib/models/grid-export.model.d.ts +2 -0
- package/input/sd-angular-core-input.metadata.json +1 -1
- package/input/src/lib/input.component.d.ts +2 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.2.22.tgz → sd-angular-core-1.2.25.tgz} +0 -0
- package/upload-excel/sd-angular-core-upload-excel.d.ts +2 -0
- package/upload-excel/sd-angular-core-upload-excel.metadata.json +1 -1
- package/upload-excel/src/lib/pipes/columm-hidden.pipe.d.ts +6 -0
- package/upload-excel/src/lib/pipes/column-transform.pipe.d.ts +5 -0
- package/upload-excel/src/lib/upload-excel.component.d.ts +3 -1
- package/upload-excel/src/lib/upload-excel.model.d.ts +3 -2
|
@@ -327,14 +327,39 @@
|
|
|
327
327
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
var SdColumnHiddenPipe = /** @class */ (function () {
|
|
331
|
+
function SdColumnHiddenPipe() {
|
|
332
|
+
}
|
|
333
|
+
SdColumnHiddenPipe.prototype.transform = function (column) {
|
|
334
|
+
if (column.hidden === undefined) {
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
if (typeof (column.hidden) === 'boolean') {
|
|
338
|
+
return !column.hidden;
|
|
339
|
+
}
|
|
340
|
+
if (typeof (column.hidden) === 'function') {
|
|
341
|
+
return !column.hidden();
|
|
342
|
+
}
|
|
343
|
+
return false;
|
|
344
|
+
};
|
|
345
|
+
return SdColumnHiddenPipe;
|
|
346
|
+
}());
|
|
347
|
+
SdColumnHiddenPipe.decorators = [
|
|
348
|
+
{ type: core.Pipe, args: [{
|
|
349
|
+
name: 'columnHidden'
|
|
350
|
+
},] }
|
|
351
|
+
];
|
|
352
|
+
SdColumnHiddenPipe.ctorParameters = function () { return []; };
|
|
353
|
+
|
|
330
354
|
var _paginator, _subscription, _reset, _reload, _mapItem, _import, _isValidDate, _isValidTime, _isValidDateTime;
|
|
331
355
|
var SdUploadExcel = /** @class */ (function () {
|
|
332
|
-
function SdUploadExcel(ref, exportService, translateService, notifyService, loadingService) {
|
|
356
|
+
function SdUploadExcel(ref, exportService, translateService, notifyService, sdColumnHidden, loadingService) {
|
|
333
357
|
var _this = this;
|
|
334
358
|
this.ref = ref;
|
|
335
359
|
this.exportService = exportService;
|
|
336
360
|
this.translateService = translateService;
|
|
337
361
|
this.notifyService = notifyService;
|
|
362
|
+
this.sdColumnHidden = sdColumnHidden;
|
|
338
363
|
this.loadingService = loadingService;
|
|
339
364
|
this.importId = 'I' + uuid.v4();
|
|
340
365
|
this.items = [];
|
|
@@ -389,17 +414,17 @@
|
|
|
389
414
|
_this.numberOfWarning = _this.items.filter(function (item) { var _a, _b; return ((_a = item.validation) === null || _a === void 0 ? void 0 : _a.warning) && !((_b = item.validation) === null || _b === void 0 ? void 0 : _b.error); }).length;
|
|
390
415
|
});
|
|
391
416
|
this.upload = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
392
|
-
var
|
|
393
|
-
var e_1,
|
|
417
|
+
var translate, _f, items, file, offset, mappingItems, data, _g, _h, _j, _k, idx, item, e_1_1, results, results, err_1;
|
|
418
|
+
var e_1, _l;
|
|
394
419
|
var _this = this;
|
|
395
|
-
return __generator(this, function (
|
|
396
|
-
switch (
|
|
420
|
+
return __generator(this, function (_m) {
|
|
421
|
+
switch (_m.label) {
|
|
397
422
|
case 0:
|
|
398
|
-
|
|
423
|
+
_m.trys.push([0, 19, 20, 21]);
|
|
399
424
|
translate = this.translateService.translate;
|
|
400
425
|
return [4 /*yield*/, __classPrivateFieldGet(this, _import).call(this)];
|
|
401
426
|
case 1:
|
|
402
|
-
_f =
|
|
427
|
+
_f = _m.sent(), items = _f.items, file = _f.file;
|
|
403
428
|
if (this.option.columns.some(function (e) { return !!e.description; })) {
|
|
404
429
|
this.hasDescription = true;
|
|
405
430
|
}
|
|
@@ -418,70 +443,86 @@
|
|
|
418
443
|
}
|
|
419
444
|
__classPrivateFieldGet(this, _reset).call(this);
|
|
420
445
|
this.originItems = items;
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
446
|
+
mappingItems = this.option.mappingItems;
|
|
447
|
+
if (!mappingItems) return [3 /*break*/, 5];
|
|
448
|
+
data = mappingItems(items);
|
|
449
|
+
if (!(data instanceof Promise)) return [3 /*break*/, 3];
|
|
450
|
+
_g = this;
|
|
451
|
+
return [4 /*yield*/, data];
|
|
425
452
|
case 2:
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
_l.label = 3;
|
|
453
|
+
_g.items = _m.sent();
|
|
454
|
+
return [3 /*break*/, 4];
|
|
429
455
|
case 3:
|
|
430
|
-
|
|
431
|
-
|
|
456
|
+
this.items = data || items;
|
|
457
|
+
_m.label = 4;
|
|
458
|
+
case 4: return [3 /*break*/, 6];
|
|
459
|
+
case 5:
|
|
460
|
+
this.items = items;
|
|
461
|
+
_m.label = 6;
|
|
462
|
+
case 6:
|
|
463
|
+
this.file = file;
|
|
464
|
+
this.loadingService.start();
|
|
465
|
+
_m.label = 7;
|
|
466
|
+
case 7:
|
|
467
|
+
_m.trys.push([7, 12, 13, 14]);
|
|
468
|
+
_h = __values(this.items.entries()), _j = _h.next();
|
|
469
|
+
_m.label = 8;
|
|
470
|
+
case 8:
|
|
471
|
+
if (!!_j.done) return [3 /*break*/, 11];
|
|
472
|
+
_k = __read(_j.value, 2), idx = _k[0], item = _k[1];
|
|
432
473
|
item.origin = Object.assign({}, item);
|
|
433
474
|
item.excelIndex = idx + (this.hasDescription ? 4 : 3);
|
|
434
475
|
return [4 /*yield*/, this.validate(item)];
|
|
435
|
-
case
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
case
|
|
439
|
-
|
|
440
|
-
return [3 /*break*/,
|
|
441
|
-
case
|
|
442
|
-
case
|
|
443
|
-
e_1_1 =
|
|
476
|
+
case 9:
|
|
477
|
+
_m.sent();
|
|
478
|
+
_m.label = 10;
|
|
479
|
+
case 10:
|
|
480
|
+
_j = _h.next();
|
|
481
|
+
return [3 /*break*/, 8];
|
|
482
|
+
case 11: return [3 /*break*/, 14];
|
|
483
|
+
case 12:
|
|
484
|
+
e_1_1 = _m.sent();
|
|
444
485
|
e_1 = { error: e_1_1 };
|
|
445
|
-
return [3 /*break*/,
|
|
446
|
-
case
|
|
486
|
+
return [3 /*break*/, 14];
|
|
487
|
+
case 13:
|
|
447
488
|
try {
|
|
448
|
-
if (
|
|
489
|
+
if (_j && !_j.done && (_l = _h.return)) _l.call(_h);
|
|
449
490
|
}
|
|
450
491
|
finally { if (e_1) throw e_1.error; }
|
|
451
492
|
return [7 /*endfinally*/];
|
|
452
|
-
case
|
|
453
|
-
if (!(!this.items.some(function (item) { return !!item.validation.error; }) && this.option.errorValidation)) return [3 /*break*/,
|
|
493
|
+
case 14:
|
|
494
|
+
if (!(!this.items.some(function (item) { return !!item.validation.error; }) && this.option.errorValidation)) return [3 /*break*/, 16];
|
|
454
495
|
return [4 /*yield*/, this.option.errorValidation(this.items)];
|
|
455
|
-
case
|
|
456
|
-
results =
|
|
496
|
+
case 15:
|
|
497
|
+
results = _m.sent();
|
|
457
498
|
results.forEach(function (result) { return _this.items[result.idx].validation.error = result.message; });
|
|
458
|
-
|
|
459
|
-
case
|
|
460
|
-
if (!(!this.items.some(function (item) { return !!item.validation.warning; }) && this.option.warningValidation)) return [3 /*break*/,
|
|
499
|
+
_m.label = 16;
|
|
500
|
+
case 16:
|
|
501
|
+
if (!(!this.items.some(function (item) { return !!item.validation.warning; }) && this.option.warningValidation)) return [3 /*break*/, 18];
|
|
461
502
|
return [4 /*yield*/, this.option.warningValidation(this.items)];
|
|
462
|
-
case
|
|
463
|
-
results =
|
|
503
|
+
case 17:
|
|
504
|
+
results = _m.sent();
|
|
464
505
|
results.forEach(function (result) { return _this.items[result.idx].validation.warning = result.message; });
|
|
465
|
-
|
|
466
|
-
case
|
|
506
|
+
_m.label = 18;
|
|
507
|
+
case 18:
|
|
467
508
|
__classPrivateFieldGet(this, _paginator).pageIndex = 0;
|
|
468
509
|
__classPrivateFieldGet(this, _reload).call(this);
|
|
469
510
|
this.ref.detectChanges();
|
|
470
511
|
this.isUploaded = false;
|
|
471
|
-
return [3 /*break*/,
|
|
472
|
-
case
|
|
473
|
-
err_1 =
|
|
512
|
+
return [3 /*break*/, 21];
|
|
513
|
+
case 19:
|
|
514
|
+
err_1 = _m.sent();
|
|
474
515
|
this.notifyService.handle.error(err_1);
|
|
475
|
-
return [3 /*break*/,
|
|
476
|
-
case
|
|
516
|
+
return [3 /*break*/, 21];
|
|
517
|
+
case 20:
|
|
477
518
|
this.loadingService.stop();
|
|
478
519
|
return [7 /*endfinally*/];
|
|
479
|
-
case
|
|
520
|
+
case 21: return [2 /*return*/];
|
|
480
521
|
}
|
|
481
522
|
});
|
|
482
523
|
}); };
|
|
483
524
|
this.validate = function (item) { return __awaiter(_this, void 0, void 0, function () {
|
|
484
|
-
var
|
|
525
|
+
var _a, validation, translate, _loop_1, this_1, _f, _g, column, e_2_1;
|
|
485
526
|
var e_2, _h;
|
|
486
527
|
return __generator(this, function (_j) {
|
|
487
528
|
switch (_j.label) {
|
|
@@ -497,12 +538,15 @@
|
|
|
497
538
|
return __generator(this, function (_f) {
|
|
498
539
|
switch (_f.label) {
|
|
499
540
|
case 0:
|
|
541
|
+
if (!this_1.sdColumnHidden.transform(column)) {
|
|
542
|
+
return [2 /*return*/, "continue"];
|
|
543
|
+
}
|
|
500
544
|
validation.data[column.field] = {};
|
|
501
545
|
_f.label = 1;
|
|
502
546
|
case 1:
|
|
503
547
|
_f.trys.push([1, 6, , 7]);
|
|
504
548
|
if (column.defaultValue !== undefined) {
|
|
505
|
-
item[column.field] = (
|
|
549
|
+
item[column.field] = (_a = item[column.field]) !== null && _a !== void 0 ? _a : column.defaultValue;
|
|
506
550
|
}
|
|
507
551
|
else if (column.required && !item[column.field] && item[column.field] !== 0) {
|
|
508
552
|
validation.data[column.field].error = "" + translate('required');
|
|
@@ -698,14 +742,14 @@
|
|
|
698
742
|
__classPrivateFieldGet(_this, _reload).call(_this);
|
|
699
743
|
};
|
|
700
744
|
this.downloadTemplate = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
701
|
-
var
|
|
745
|
+
var _b, sheets, _f, _g, sheet, _h, _j, _k, e_3_1, columnNotHidden, excelTemplate, result;
|
|
702
746
|
var e_3, _l;
|
|
703
747
|
var _this = this;
|
|
704
748
|
return __generator(this, function (_m) {
|
|
705
749
|
switch (_m.label) {
|
|
706
750
|
case 0:
|
|
707
751
|
sheets = [];
|
|
708
|
-
if (!Array.isArray((
|
|
752
|
+
if (!Array.isArray((_b = this.option) === null || _b === void 0 ? void 0 : _b.sheets)) return [3 /*break*/, 9];
|
|
709
753
|
_m.label = 1;
|
|
710
754
|
case 1:
|
|
711
755
|
_m.trys.push([1, 7, 8, 9]);
|
|
@@ -748,9 +792,10 @@
|
|
|
748
792
|
finally { if (e_3) throw e_3.error; }
|
|
749
793
|
return [7 /*endfinally*/];
|
|
750
794
|
case 9:
|
|
795
|
+
columnNotHidden = this.option.columns.filter(function (column) { return _this.sdColumnHidden.transform(column); });
|
|
751
796
|
excelTemplate = {
|
|
752
797
|
fileName: this.option.fileName || 'Template',
|
|
753
|
-
columns:
|
|
798
|
+
columns: columnNotHidden.map(function (column) {
|
|
754
799
|
return {
|
|
755
800
|
field: column.field,
|
|
756
801
|
title: column.title,
|
|
@@ -775,6 +820,7 @@
|
|
|
775
820
|
});
|
|
776
821
|
}); };
|
|
777
822
|
this.export = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
823
|
+
var _this = this;
|
|
778
824
|
return __generator(this, function (_f) {
|
|
779
825
|
switch (_f.label) {
|
|
780
826
|
case 0:
|
|
@@ -785,7 +831,7 @@
|
|
|
785
831
|
title: this.translateService.translate('Upload message'),
|
|
786
832
|
width: '250px',
|
|
787
833
|
required: false
|
|
788
|
-
}], this.option.columns),
|
|
834
|
+
}], this.option.columns.filter(function (column) { return _this.sdColumnHidden.transform(column); })),
|
|
789
835
|
items: this.filteredItems.map(function (e) {
|
|
790
836
|
var _a, _b, _c, _d;
|
|
791
837
|
return (Object.assign(Object.assign({}, e.origin), { sdMessage: (_d = (((_a = e.validation) === null || _a === void 0 ? void 0 : _a.error) || ((_b = e.validation) === null || _b === void 0 ? void 0 : _b.warning) || ((_c = e.validation) === null || _c === void 0 ? void 0 : _c.success))) === null || _d === void 0 ? void 0 : _d.replace(/<strong>/g, '').replace(/<\/strong>/g, '').replace(/<br>/g, '\n') }));
|
|
@@ -914,7 +960,7 @@
|
|
|
914
960
|
SdUploadExcel.decorators = [
|
|
915
961
|
{ type: core.Component, args: [{
|
|
916
962
|
selector: 'sd-upload-excel',
|
|
917
|
-
template: "<sd-modal [title]=\"(option?.title || 'Import Excel')| sdTranslate\" #modal>\r\n <sd-modal-body background=\"#F0F8FF\">\r\n <div class=\"row mx-0 mb-10\">\r\n <sd-button *ngIf=\"items?.length\" class=\"mr-5\" (action)=\"view('ALL')\" icon=\"cached\"\r\n [title]=\"'View all' | sdTranslate\" size=\"sm\"></sd-button>\r\n <sd-button *ngIf=\"numberOfSuccess\" class=\"mr-5\" (action)=\"view('SUCCESS')\" icon=\"done\" [title]=\"numberOfSuccess\"\r\n [tooltip]=\"'Number of success rows' | sdTranslate\" size=\"sm\" color=\"success\"></sd-button>\r\n <sd-button *ngIf=\"numberOfWarning\" class=\"mr-5\" (action)=\"view('WARNING')\" icon=\"warning\"\r\n [title]=\"numberOfWarning\" [tooltip]=\"'Number of warning rows' | sdTranslate\" size=\"sm\"></sd-button>\r\n <sd-button *ngIf=\"numberOfError\" class=\"mr-5\" (action)=\"view('ERROR')\" icon=\"error\" [title]=\"numberOfError\"\r\n color=\"danger\" [tooltip]=\"'Number of error rows' | sdTranslate\" size=\"sm\"></sd-button>\r\n </div>\r\n <div class=\"sd-box\">\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"table-responsive\" style=\"position: relative; height:50vh\">\r\n <table class=\"table table-striped table-sm table-hover table-bordered\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"text-center position-sticky c-sticky-left\" style=\"width: 50px\">#</th>\r\n <th *ngIf=\"filteredItems?.length\" class=\"text-center\" style=\"min-width: 250px; width: 250px\">\r\n {{'Upload message' | sdTranslate}}</th>\r\n <
|
|
963
|
+
template: "<sd-modal [title]=\"(option?.title || 'Import Excel')| sdTranslate\" #modal>\r\n <sd-modal-body background=\"#F0F8FF\">\r\n <div class=\"row mx-0 mb-10\">\r\n <sd-button *ngIf=\"items?.length\" class=\"mr-5\" (action)=\"view('ALL')\" icon=\"cached\"\r\n [title]=\"'View all' | sdTranslate\" size=\"sm\"></sd-button>\r\n <sd-button *ngIf=\"numberOfSuccess\" class=\"mr-5\" (action)=\"view('SUCCESS')\" icon=\"done\" [title]=\"numberOfSuccess\"\r\n [tooltip]=\"'Number of success rows' | sdTranslate\" size=\"sm\" color=\"success\"></sd-button>\r\n <sd-button *ngIf=\"numberOfWarning\" class=\"mr-5\" (action)=\"view('WARNING')\" icon=\"warning\"\r\n [title]=\"numberOfWarning\" [tooltip]=\"'Number of warning rows' | sdTranslate\" size=\"sm\"></sd-button>\r\n <sd-button *ngIf=\"numberOfError\" class=\"mr-5\" (action)=\"view('ERROR')\" icon=\"error\" [title]=\"numberOfError\"\r\n color=\"danger\" [tooltip]=\"'Number of error rows' | sdTranslate\" size=\"sm\"></sd-button>\r\n </div>\r\n <div class=\"sd-box\">\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"table-responsive\" style=\"position: relative; height:50vh\">\r\n <table class=\"table table-striped table-sm table-hover table-bordered\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"text-center position-sticky c-sticky-left\" style=\"width: 50px\">#</th>\r\n <th *ngIf=\"filteredItems?.length\" class=\"text-center\" style=\"min-width: 250px; width: 250px\">\r\n {{'Upload message' | sdTranslate}}</th>\r\n <ng-container *ngFor=\"let column of option.columns\">\r\n <th *ngIf=\"column | columnHidden\"\r\n [ngStyle]=\"{'min-width':column.width ? column.width : '300px'}\" [matTooltip]=\"column.title\">\r\n <span class=\"c-ellipsis\"\r\n [ngStyle]=\"{'min-width':column.width ? column.width : '300px', 'max-width':column.width ? column.width : '300px'}\">{{column.title}}</span>\r\n </th>\r\n </ng-container>\r\n </tr>\r\n </thead>\r\n <tbody *ngIf=\"viewItems.length\">\r\n <tr *ngFor=\"let item of viewItems\">\r\n <td class=\"text-center position-sticky c-sticky-left\" style=\"width: 50px\">\r\n <span class=\"badge\"\r\n [ngClass]=\"{'badge-success':!item.validation?.warning && !item.validation?.error, 'badge-warning':item.validation?.warning && !item.validation?.error, 'badge-danger':item.validation?.error}\"\r\n style=\"width: 100%\">{{item.excelIndex}}</span>\r\n </td>\r\n <td style=\"min-width: 250px; width: 250px\">\r\n <div\r\n [innerHtml]=\"item.validation?.error || item.validation?.warning || item.validation?.success || ('Success' | sdTranslate)\">\r\n </div>\r\n </td>\r\n <ng-container *ngFor=\"let column of option.columns\">\r\n <td *ngIf=\"column | columnHidden\" class=\"align-middle\"\r\n [ngClass]=\"{'table-warning':item.validation?.data[column.field]?.warning && !item.validation?.data[column.field]?.error, 'table-danger':item.validation?.data[column.field]?.error}\"\r\n [matTooltip]=\"item.validation?.data[column.field]?.error || item.validation?.data[column.field]?.warning\"\r\n [ngStyle]=\"{'min-width':column.width ? column.width : '300px'}\" matTooltipPosition=\"above\">\r\n <span class=\"c-ellipsis\">\r\n <ng-container *ngIf=\"column.type === 'date' || column.type === 'datetime' && item.origin\">\r\n {{item.origin[column.field] | columnTransform:item:column | async}}\r\n </ng-container>\r\n <ng-container *ngIf=\"column.type === 'number'\">\r\n {{item.validation?.data[column.field]?.error ? (item[column.field] | columnTransform:item:column | async): (item[column.field] | number :\r\n '1.0-2')}}\r\n </ng-container>\r\n <ng-container *ngIf=\"column.type === 'array'\">\r\n {{item[column.field]?.split(column.divideString)?.length}} {{column.unitString}}\r\n <button mat-button [matMenuTriggerFor]=\"menu\" class=\"c-mat-menu\">\r\n <mat-icon>open_in_new</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <div class=\"row mx-0\">\r\n <div class=\"col-6\" *ngFor=\"let itemArray of item[column.field]?.split(column.divideString)\">\r\n {{itemArray | columnTransform:item:column | async}}\r\n </div>\r\n </div>\r\n </mat-menu>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"column.type !== 'date' && column.type !== 'datetime' && column.type !== 'number' && column.type !== 'array'\">\r\n <!-- {{item[column.field]}} -->\r\n {{item[column.field] | columnTransform:item:column | async}}\r\n\r\n </ng-container>\r\n </span>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n <div class=\"sd-box-footer clearfix\">\r\n <div style=\"display: flex; align-items: center; align-content: space-between;\">\r\n <div style=\"flex: 1;\" [innerHTML]=\"option?.note\">\r\n </div>\r\n <div style=\"flex: 1;\">\r\n <mat-paginator [length]=\"filteredItems?.length || 0\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </sd-modal-body>\r\n <sd-modal-footer *sdDesktop>\r\n <div class=\"mr-auto\">\r\n <sd-button class=\"mr-5\" (action)=\"upload()\" icon=\"file_upload\" [title]=\"'Upload' | sdTranslate\" size=\"sm\"\r\n color=\"info\"></sd-button>\r\n <sd-button class=\"mr-5\" (action)=\"downloadTemplate()\" icon=\"file_download\" [loading]=\"isDownloadTemplate\"\r\n [title]=\"'Download template' | sdTranslate\" color=\"info\" type=\"outline\" size=\"sm\">\r\n </sd-button>\r\n </div>\r\n <sd-button *ngIf=\"filteredItems?.length\" class=\"mr-5\" (action)=\"export()\" icon=\"get_app\"\r\n [title]=\"'Download result' | sdTranslate\" size=\"sm\" color=\"info\" type=\"outline\">\r\n </sd-button>\r\n <sd-button (action)=\"accept()\" [title]=\"'Accept' | sdTranslate\"\r\n [disabled]=\"numberOfSuccess === 0 || numberOfError > 0 || isUploaded\" color=\"primary\" type=\"fill\" size=\"sm\">\r\n </sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"upload()\" icon=\"file_upload\"\r\n [title]=\"'Upload' | sdTranslate\" width=\"100%\" size=\"sm\" color=\"info\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"accept()\" icon=\"check\" [title]=\"'Accept' | sdTranslate\"\r\n [disabled]=\"numberOfSuccess === 0 || numberOfError > 0\" color=\"success\" width=\"100%\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>",
|
|
918
964
|
styles: [".table thead td,.table thead th{padding-bottom:5px;padding-top:5px}.table-striped tbody tr:nth-of-type(2n) .c-sticky-left{background-color:#fff}.table-striped tbody tr:nth-of-type(odd) .c-sticky-left{background-color:#f2f2f2}.c-sticky-left{border-left:none!important;border-right:none!important;left:0!important;z-index:20}.c-ellipsis{display:block;overflow:hidden!important;padding:.1rem;text-overflow:ellipsis;white-space:nowrap}.c-mat-menu{border:none}.c-mat-menu mat-icon{font-size:20px;vertical-align:middle}:host ::ng-deep .mat-paginator-container{height:32px;min-height:32px}:host ::ng-deep .mat-paginator-container .mat-icon-button{height:28px;line-height:28px;width:28px}"]
|
|
919
965
|
},] }
|
|
920
966
|
];
|
|
@@ -923,6 +969,7 @@
|
|
|
923
969
|
{ type: _export.SdExportService },
|
|
924
970
|
{ type: translate.SdTranslateService },
|
|
925
971
|
{ type: notify.SdNotifyService },
|
|
972
|
+
{ type: SdColumnHiddenPipe },
|
|
926
973
|
{ type: loading.SdLoadingService }
|
|
927
974
|
]; };
|
|
928
975
|
SdUploadExcel.propDecorators = {
|
|
@@ -931,6 +978,26 @@
|
|
|
931
978
|
paginator: [{ type: core.ViewChild, args: [paginator.MatPaginator,] }]
|
|
932
979
|
};
|
|
933
980
|
|
|
981
|
+
var SdColumnTransformPipe = /** @class */ (function () {
|
|
982
|
+
function SdColumnTransformPipe() {
|
|
983
|
+
var _this = this;
|
|
984
|
+
this.transform = function (value, rowData, column) { return __awaiter(_this, void 0, void 0, function () {
|
|
985
|
+
return __generator(this, function (_a) {
|
|
986
|
+
if (column === null || column === void 0 ? void 0 : column.transform) {
|
|
987
|
+
return [2 /*return*/, column.transform(value, rowData)];
|
|
988
|
+
}
|
|
989
|
+
return [2 /*return*/, value];
|
|
990
|
+
});
|
|
991
|
+
}); };
|
|
992
|
+
}
|
|
993
|
+
return SdColumnTransformPipe;
|
|
994
|
+
}());
|
|
995
|
+
SdColumnTransformPipe.decorators = [
|
|
996
|
+
{ type: core.Pipe, args: [{
|
|
997
|
+
name: 'columnTransform'
|
|
998
|
+
},] }
|
|
999
|
+
];
|
|
1000
|
+
|
|
934
1001
|
var SdUploadExcelModule = /** @class */ (function () {
|
|
935
1002
|
function SdUploadExcelModule() {
|
|
936
1003
|
}
|
|
@@ -956,7 +1023,10 @@
|
|
|
956
1023
|
menu.MatMenuModule
|
|
957
1024
|
],
|
|
958
1025
|
declarations: [
|
|
959
|
-
SdUploadExcel
|
|
1026
|
+
SdUploadExcel,
|
|
1027
|
+
// pipe
|
|
1028
|
+
SdColumnHiddenPipe,
|
|
1029
|
+
SdColumnTransformPipe
|
|
960
1030
|
],
|
|
961
1031
|
exports: [
|
|
962
1032
|
SdUploadExcel
|
|
@@ -971,6 +1041,8 @@
|
|
|
971
1041
|
|
|
972
1042
|
exports.SdUploadExcel = SdUploadExcel;
|
|
973
1043
|
exports.SdUploadExcelModule = SdUploadExcelModule;
|
|
1044
|
+
exports.ɵa = SdColumnHiddenPipe;
|
|
1045
|
+
exports.ɵb = SdColumnTransformPipe;
|
|
974
1046
|
|
|
975
1047
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
976
1048
|
|