ps-toolkit-ui 0.0.119 → 0.0.120

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.
@@ -2566,9 +2566,6 @@
2566
2566
  var opts = this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ?
2567
2567
  [this.addChildren] : [];
2568
2568
  var _loop_1 = function (option) {
2569
- if (this_1.table.options.filter(function (x) { return x.name === option.Name; }).length > 0) {
2570
- return "continue";
2571
- }
2572
2569
  var opt = new InputClass(this_1.table.environment, this_1.table.l, option.Name, option.Icon, option.InputType === exports.PermissionInputTypeEnum.Icon ? exports.InputType.Icon : exports.InputType.Button, 'blue h-25 m-h-5 d-ib va-m f-u');
2573
2570
  if (option.Action === 'Update') {
2574
2571
  if (this_1.table.form) {
@@ -2632,7 +2629,7 @@
2632
2629
  opt.urlNewTab = option.InputAction === exports.PermissionInputActionEnum.LinkNewTab;
2633
2630
  }
2634
2631
  else if (option.InputAction === exports.PermissionInputActionEnum.Modal) {
2635
- opt.modal = option.Modal;
2632
+ opt.modal = this_1.table.optionActions[option.Action].Modal;
2636
2633
  opt.onClick = function (btn) {
2637
2634
  var e_2, _a;
2638
2635
  if (opt.modal.table) {
@@ -2995,11 +2992,7 @@
2995
2992
  }
2996
2993
  };
2997
2994
  TableComponent.prototype.getOptions = function () {
2998
- return this.table.options.map(function (o) {
2999
- var i = HelperClass.clone(o);
3000
- i.class = i.class + ' m-h-5 h-25 d-ib va-m f-u';
3001
- return i;
3002
- }).concat(this.table.permissions && this.table.permissions.hasAccess('Delete') ? [this.optDelete] : []);
2995
+ return [];
3003
2996
  };
3004
2997
  TableComponent.prototype.setSortable = function () {
3005
2998
  var _this = this;
@@ -3027,7 +3020,24 @@
3027
3020
  return c;
3028
3021
  };
3029
3022
  TableComponent.prototype.getOptionModals = function () {
3030
- return this.table.options.filter(function (x) { return x.modal != null; });
3023
+ var e_2, _a;
3024
+ var modals = [];
3025
+ try {
3026
+ for (var _b = __values(Object.entries(this.table.optionActions)), _c = _b.next(); !_c.done; _c = _b.next()) {
3027
+ var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
3028
+ if (this.table.optionActions[key].modal) {
3029
+ modals.push(this.table.optionActions[key].modal);
3030
+ }
3031
+ }
3032
+ }
3033
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
3034
+ finally {
3035
+ try {
3036
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3037
+ }
3038
+ finally { if (e_2) throw e_2.error; }
3039
+ }
3040
+ return modals;
3031
3041
  };
3032
3042
  TableComponent.prototype.onChangeRows = function (e) {
3033
3043
  return this.changeRows.emit(e);
@@ -6615,22 +6625,22 @@
6615
6625
  }, 500);
6616
6626
  };
6617
6627
  TableReportComponent.prototype.getOptions = function () {
6618
- var _this = this;
6619
- return (this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ? [this.addChildren] : [])
6620
- .concat(this.table.options.map(function (o) {
6621
- var i = HelperClass.clone(o);
6622
- if (i.url) {
6623
- i.url = i.url.replace('{}', _this.row.Id);
6624
- }
6625
- if (i.modal && i.modal.form) {
6626
- i.modal.form.url = i.modal.form.url.replace('{}', _this.row.Id);
6627
- }
6628
- i.row = _this.row;
6629
- i.class = i.class + ' m-h-5 h-25 d-ib va-m f-u';
6630
- return i;
6631
- })).concat(this.table.hasStatus ? [this.optStatus] : [])
6632
- .concat(this.table.permissions.hasAccess('Update') ? [this.optEdit] : [])
6633
- .concat(this.table.permissions.hasAccess('Delete') ? [this.optDelete] : []);
6628
+ return [];
6629
+ // return (this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ? [this.addChildren] : [])
6630
+ // .concat(this.table.options.map((o) => {
6631
+ // const i = HelperClass.clone(o);
6632
+ // if (i.url){
6633
+ // i.url = i.url.replace('{}', this.row.Id);
6634
+ // }
6635
+ // if (i.modal && i.modal.form){
6636
+ // i.modal.form.url = i.modal.form.url.replace('{}', this.row.Id);
6637
+ // }
6638
+ // i.row = this.row;
6639
+ // i.class = i.class + ' m-h-5 h-25 d-ib va-m f-u';
6640
+ // return i;
6641
+ // })).concat(this.table.hasStatus ? [this.optStatus] : [])
6642
+ // .concat(this.table.permissions.hasAccess('Update') ? [this.optEdit] : [])
6643
+ // .concat(this.table.permissions.hasAccess('Delete') ? [this.optDelete] : []);
6634
6644
  };
6635
6645
  TableReportComponent.prototype.getCell = function (col) {
6636
6646
  console.log('getCell');
@@ -7107,7 +7117,7 @@
7107
7117
  this.perPage = 10;
7108
7118
  this.cols = [];
7109
7119
  this.buttons = [];
7110
- this.options = [];
7120
+ this.optionActions = {};
7111
7121
  this.rows = [];
7112
7122
  this.count = 0;
7113
7123
  this.page = 1;