ps-toolkit-ui 1.22.36 → 1.22.38

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.
@@ -7546,6 +7546,35 @@
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
+ if (this.inp.table.onLoad) {
7574
+ this.inp.table.onLoad(this.inp.table.rows);
7575
+ }
7576
+ }
7577
+ };
7549
7578
  return FormTableComponent;
7550
7579
  }());
7551
7580
  FormTableComponent.decorators = [
@@ -7558,7 +7587,9 @@
7558
7587
  FormTableComponent.ctorParameters = function () { return []; };
7559
7588
  FormTableComponent.propDecorators = {
7560
7589
  inp: [{ type: core.Input }],
7561
- changeIndex: [{ type: core.Output }]
7590
+ changeIndex: [{ type: core.Output }],
7591
+ onCopy: [{ type: core.HostListener, args: ['document:copy', ['$event'],] }],
7592
+ onPaste: [{ type: core.HostListener, args: ['document:paste', ['$event'],] }]
7562
7593
  };
7563
7594
 
7564
7595
  var FormTextareaComponent = /** @class */ (function () {