tnx-shared 5.1.489 → 5.1.491

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.
@@ -375,11 +375,11 @@
375
375
  if (_ = accept(result.set))
376
376
  descriptor.set = _;
377
377
  if (_ = accept(result.init))
378
- initializers.push(_);
378
+ initializers.unshift(_);
379
379
  }
380
380
  else if (_ = accept(result)) {
381
381
  if (kind === "field")
382
- initializers.push(_);
382
+ initializers.unshift(_);
383
383
  else
384
384
  descriptor[key] = _;
385
385
  }
@@ -666,6 +666,33 @@
666
666
  throw new TypeError("Cannot use 'in' operator on non-object");
667
667
  return typeof state === "function" ? receiver === state : state.has(receiver);
668
668
  }
669
+ var tslib_es6 = {
670
+ __extends: __extends,
671
+ __assign: __assign,
672
+ __rest: __rest,
673
+ __decorate: __decorate,
674
+ __param: __param,
675
+ __metadata: __metadata,
676
+ __awaiter: __awaiter,
677
+ __generator: __generator,
678
+ __createBinding: __createBinding,
679
+ __exportStar: __exportStar,
680
+ __values: __values,
681
+ __read: __read,
682
+ __spread: __spread,
683
+ __spreadArrays: __spreadArrays,
684
+ __spreadArray: __spreadArray,
685
+ __await: __await,
686
+ __asyncGenerator: __asyncGenerator,
687
+ __asyncDelegator: __asyncDelegator,
688
+ __asyncValues: __asyncValues,
689
+ __makeTemplateObject: __makeTemplateObject,
690
+ __importStar: __importStar,
691
+ __importDefault: __importDefault,
692
+ __classPrivateFieldGet: __classPrivateFieldGet,
693
+ __classPrivateFieldSet: __classPrivateFieldSet,
694
+ __classPrivateFieldIn: __classPrivateFieldIn,
695
+ };
669
696
 
670
697
  exports.EnumLoaiVanBanBase = void 0;
671
698
  (function (EnumLoaiVanBanBase) {
@@ -4358,6 +4385,15 @@
4358
4385
  CommonService.prototype.appendStringWithSpace = function (original, append, connector) {
4359
4386
  return "" + original + (append && append !== '' ? (" " + (connector ? connector : '') + " ") + append : '');
4360
4387
  };
4388
+ CommonService.prototype.findLastIndex = function (array, predicate) {
4389
+ var l = array.length;
4390
+ while (l--) {
4391
+ if (predicate(array[l], l, array)) {
4392
+ return l;
4393
+ }
4394
+ }
4395
+ return -1;
4396
+ };
4361
4397
  return CommonService;
4362
4398
  }());
4363
4399
  CommonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0__namespace.ɵɵinject(ModuleConfigService)); }, token: CommonService, providedIn: "root" });
@@ -21530,17 +21566,53 @@
21530
21566
  _this.handleCheckRowData = function (rowData, trElement, fireEvent) {
21531
21567
  if (trElement === void 0) { trElement = null; }
21532
21568
  if (fireEvent === void 0) { fireEvent = true; }
21569
+ var indexHasRowSpan = _this._commonService.findLastIndex(_this.model.dataSource, function (x, i) { return Object.values(x.rowSpan).length > 0 && i <= rowData._indexInDataSource; });
21533
21570
  if (!rowData._checked) {
21534
21571
  _this.model.selectedItem = null;
21535
- var index = _this.model.selectedItems.findIndex(function (p) { return p.id == rowData.id; });
21536
- if (index > -1) {
21537
- _this.model.selectedItems.splice(index, 1);
21572
+ var indexHasRowSpanUnChecked = _this._commonService.findLastIndex(_this.model.selectedItems, function (x, i) { return Object.values(x.rowSpan).length > 0 && i <= rowData._indexInDataSource; });
21573
+ if (indexHasRowSpanUnChecked > -1) {
21574
+ var rowSpan = Object.values(_this.model.selectedItems[indexHasRowSpanUnChecked].rowSpan);
21575
+ if (rowSpan.length > 1) {
21576
+ var maxRowSpan = rowSpan.reduce(function (accumulator, element) {
21577
+ return (accumulator > element) ? accumulator : element;
21578
+ });
21579
+ var index = _this.model.selectedItems.findIndex(function (p) { return p.id == rowData.id; });
21580
+ if (index > -1) {
21581
+ for (var i = indexHasRowSpan; i < maxRowSpan + indexHasRowSpan; i++) {
21582
+ _this.model.dataSource[i]._checked = false;
21583
+ }
21584
+ _this.model.selectedItems.splice(indexHasRowSpanUnChecked, maxRowSpan);
21585
+ }
21586
+ }
21587
+ }
21588
+ else {
21589
+ var index = _this.model.selectedItems.findIndex(function (p) { return p.id == rowData.id; });
21590
+ if (index > -1) {
21591
+ _this.model.selectedItems.splice(index, 1);
21592
+ }
21538
21593
  }
21539
21594
  }
21540
21595
  else {
21541
21596
  if (!rowData.hiddenCheckBox) {
21542
- _this.model.selectedItems.push(rowData);
21543
- _this.model.selectedItem = rowData;
21597
+ if (indexHasRowSpan > -1) {
21598
+ var rowSpan = Object.values(_this.model.dataSource[indexHasRowSpan].rowSpan);
21599
+ if (rowSpan.length > 1) {
21600
+ var maxRowSpan = rowSpan.reduce(function (accumulator, element) {
21601
+ return (accumulator > element) ? accumulator : element;
21602
+ });
21603
+ for (var i = indexHasRowSpan; i < maxRowSpan + indexHasRowSpan; i++) {
21604
+ _this.model.dataSource[i]._checked = true;
21605
+ }
21606
+ _this.model.selectedItems = _this.model.selectedItems.concat(_this.model.dataSource.slice(indexHasRowSpan, indexHasRowSpan + maxRowSpan));
21607
+ _this.model.selectedItem = _this.model.dataSource.slice(indexHasRowSpan, indexHasRowSpan + maxRowSpan);
21608
+ }
21609
+ }
21610
+ else {
21611
+ if (!rowData.hiddenCheckBox) {
21612
+ _this.model.selectedItems.push(rowData);
21613
+ _this.model.selectedItem = rowData;
21614
+ }
21615
+ }
21544
21616
  }
21545
21617
  }
21546
21618
  _this.setLastItemSelected();
@@ -22360,6 +22432,20 @@
22360
22432
  var table = css + "<table>" + strHeadEle + strBodyEle + "</table>";
22361
22433
  this._printService.printHtmlContent(table, header.toUpperCase());
22362
22434
  };
22435
+ ListComponentBase.prototype.printByReadingHtmlHasRowSpan = function () {
22436
+ var header = 'Danh sách ' + this.setting.objectName;
22437
+ var element = this.table.el.nativeElement;
22438
+ var tableEle = element.querySelector('table');
22439
+ var headEle = tableEle.querySelector('thead');
22440
+ var bodyEle = tableEle.querySelector('tbody');
22441
+ var arrHeadEle = this.getArrHeadByHtml(headEle);
22442
+ var arrRowData = this.getArrRowDataHasRowSpanByHtml(bodyEle, arrHeadEle);
22443
+ var strHeadEle = this.headHtmlToString(arrHeadEle);
22444
+ var strBodyEle = this.rowDataHtmlHasRowSpanToString(arrRowData);
22445
+ var css = '<style type="text/css">table th, table td {border:1px solid #000;} table th {text-align: center;} table {width: 100%;border-collapse: collapse;} table td:first-child {text-align: center;}</style>';
22446
+ var table = css + "<table>" + strHeadEle + strBodyEle + "</table>";
22447
+ this._printService.printHtmlContent(table, header.toUpperCase());
22448
+ };
22363
22449
  ListComponentBase.prototype.exportAll = function () {
22364
22450
  this.exportByReadingHtml(true);
22365
22451
  };
@@ -22426,6 +22512,32 @@
22426
22512
  }
22427
22513
  return arrHeader;
22428
22514
  };
22515
+ ListComponentBase.prototype.getArrRowDataHasRowSpanByHtml = function (bodyEle, arrHead, exportAll) {
22516
+ if (exportAll === void 0) { exportAll = false; }
22517
+ var arrRow = exportAll ? bodyEle.querySelectorAll('tr') : bodyEle.querySelectorAll('tr.ui-state-highlight');
22518
+ if (!arrRow.length) {
22519
+ return [];
22520
+ }
22521
+ var arrRowData = [];
22522
+ for (var i = 0; i < arrRow.length; i++) {
22523
+ var row = arrRow[i];
22524
+ var arrTd = row.querySelectorAll('td');
22525
+ arrRowData.push(__spread(arrTd).filter(function (x) { return !x.className.includes('chkbox link-or-action cell-checkbox'); }).map(function (x) { return ({ value: x.innerText, rowSpan: x.rowSpan }); }));
22526
+ }
22527
+ return arrRowData;
22528
+ };
22529
+ ListComponentBase.prototype.rowDataHtmlHasRowSpanToString = function (rowDatas) {
22530
+ var arrRowData = [];
22531
+ rowDatas.forEach(function (arrRowDataChild) {
22532
+ var rowData = '<tr>';
22533
+ arrRowDataChild.forEach(function (element) {
22534
+ rowData += "<td rowSpan=\"" + element.rowSpan + "\">" + element.value + "</td>";
22535
+ });
22536
+ rowData += '</tr>';
22537
+ arrRowData.push(rowData);
22538
+ });
22539
+ return arrRowData.join(' ');
22540
+ };
22429
22541
  ListComponentBase.prototype.getArrRowDataByHtml = function (bodyEle, arrHead, exportAll) {
22430
22542
  var _this = this;
22431
22543
  if (exportAll === void 0) { exportAll = false; }
@@ -22453,7 +22565,6 @@
22453
22565
  for (var i = 0; i < arrRow.length; i++) {
22454
22566
  _loop_2(i);
22455
22567
  }
22456
- ;
22457
22568
  return arrRowData;
22458
22569
  };
22459
22570
  ListComponentBase.prototype.getValueCheckboxFormat = function (data) {
@@ -54191,6 +54302,8 @@
54191
54302
  return 'separator.0';
54192
54303
  };
54193
54304
  NumberPickerRangeComponent.prototype.getThousandSeperator = function () {
54305
+ if (this.maskType === 'intWithoutMask')
54306
+ return '';
54194
54307
  return '.';
54195
54308
  };
54196
54309
  NumberPickerRangeComponent.prototype.checkValueInRange = function () {