ps-toolkit-ui 1.22.35 → 1.22.37

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.
@@ -4003,7 +4003,7 @@
4003
4003
  var cv = _.get(row.Data, col.name);
4004
4004
  if (row.Data.isSum) {
4005
4005
  if (idx === 0) {
4006
- return this.l('SumCountCol', this.count);
4006
+ return this.l('SumCountCol', this.data().length === 0 ? this.count : this.data().length);
4007
4007
  }
4008
4008
  else if (col.sumFun != null) {
4009
4009
  return col.sumFun(this.sumRow);
@@ -4144,8 +4144,8 @@
4144
4144
  };
4145
4145
  TableClass.prototype.setSumRow = function () {
4146
4146
  if (this.sumRowBase != null) {
4147
- var checks_1 = this.rows.filter(function (x) { return x.checked === true; });
4148
- if (checks_1.length == 0) {
4147
+ var checks_1 = this.data();
4148
+ if (checks_1.length === 0) {
4149
4149
  this.sumRow = HelperClass.clone(this.sumRowBase);
4150
4150
  this.sumRow.isSum = true;
4151
4151
  return;
@@ -4869,7 +4869,7 @@
4869
4869
  this.table.rows.forEach(function (x) { return x.checked = true; });
4870
4870
  }
4871
4871
  if (this.table.onChangeCheck) {
4872
- this.table.onChangeCheck(this.table.rows.filter(function (x) { return x.checked === true; }));
4872
+ this.table.onChangeCheck(this.table.data());
4873
4873
  }
4874
4874
  this.table.setSumRow();
4875
4875
  };
@@ -7546,6 +7546,32 @@
7546
7546
  this.inp.onChange(e);
7547
7547
  }
7548
7548
  };
7549
+ FormTableComponent.prototype.onCopy = function (event) {
7550
+ if (this.inp.table.data().length) {
7551
+ event.preventDefault();
7552
+ var data = JSON.stringify({
7553
+ table: this.inp.table.name,
7554
+ rows: this.inp.table.data()
7555
+ });
7556
+ navigator.clipboard.writeText(data).then(function () { });
7557
+ }
7558
+ };
7559
+ FormTableComponent.prototype.onPaste = function (event) {
7560
+ var _b;
7561
+ var _this = this;
7562
+ var _a;
7563
+ var text = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text');
7564
+ var data = JSON.parse(text);
7565
+ if (data.table === this.inp.table.name) {
7566
+ (_b = this.inp.table.rows).push.apply(_b, __spread(data.rows.map(function (row) {
7567
+ row.Id = parseInt(HelperClass.random(5, false, false), 10);
7568
+ return {
7569
+ Data: row,
7570
+ Options: _this.inp.table.permissions.Accesses.filter(function (a) { return a.AccessType === exports.PermissionAccessTypeEnum.Update || a.AccessType === exports.PermissionAccessTypeEnum.Delete; })
7571
+ };
7572
+ })));
7573
+ }
7574
+ };
7549
7575
  return FormTableComponent;
7550
7576
  }());
7551
7577
  FormTableComponent.decorators = [
@@ -7558,7 +7584,9 @@
7558
7584
  FormTableComponent.ctorParameters = function () { return []; };
7559
7585
  FormTableComponent.propDecorators = {
7560
7586
  inp: [{ type: core.Input }],
7561
- changeIndex: [{ type: core.Output }]
7587
+ changeIndex: [{ type: core.Output }],
7588
+ onCopy: [{ type: core.HostListener, args: ['document:copy', ['$event'],] }],
7589
+ onPaste: [{ type: core.HostListener, args: ['document:paste', ['$event'],] }]
7562
7590
  };
7563
7591
 
7564
7592
  var FormTextareaComponent = /** @class */ (function () {