ps-toolkit-ui 0.0.33 → 0.0.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.
@@ -2525,6 +2525,9 @@
2525
2525
  };
2526
2526
  TableRowComponent.prototype.getOptions = function () {
2527
2527
  var _this = this;
2528
+ console.log(this.table.options);
2529
+ console.log(this.table.options.map(function (x) { return x.condition; }));
2530
+ console.log(this.table.options.map(function (x) { return _this.row[x.condition]; }));
2528
2531
  return (this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ? [this.addChildren] : [])
2529
2532
  .concat(this.table.options.filter(function (x) { return x.condition == null ||
2530
2533
  (x.condition.startsWith('!') ? !_this.row[x.condition.substring(1)] : _this.row[x.condition]); }).map(function (o) {
@@ -5053,13 +5056,14 @@
5053
5056
  };
5054
5057
 
5055
5058
  var PermissionClass = /** @class */ (function () {
5056
- function PermissionClass(Name, Icon, Type, Area, Controller, Action, Accesses) {
5059
+ function PermissionClass(Name, Icon, Type, Area, Controller, Action, condition, Accesses) {
5057
5060
  if (Name === void 0) { Name = ''; }
5058
5061
  if (Icon === void 0) { Icon = ''; }
5059
5062
  if (Type === void 0) { Type = null; }
5060
5063
  if (Area === void 0) { Area = ''; }
5061
5064
  if (Controller === void 0) { Controller = ''; }
5062
5065
  if (Action === void 0) { Action = ''; }
5066
+ if (condition === void 0) { condition = null; }
5063
5067
  if (Accesses === void 0) { Accesses = []; }
5064
5068
  this.Name = Name;
5065
5069
  this.Icon = Icon;
@@ -5067,6 +5071,7 @@
5067
5071
  this.Area = Area;
5068
5072
  this.Controller = Controller;
5069
5073
  this.Action = Action;
5074
+ this.condition = condition;
5070
5075
  this.Accesses = Accesses;
5071
5076
  this.RelatedId = null;
5072
5077
  this.Condition = null;
@@ -6893,12 +6898,13 @@
6893
6898
  }
6894
6899
  }
6895
6900
  BaseComponent.prototype.getPermission = function (c, a) {
6901
+ if (a === void 0) { a = null; }
6896
6902
  var p = this.app.currentUser.Permissions.filter(function (per) { return per.Controller === c && (a == null || per.Action === a) &&
6897
6903
  per.Type === exports.PermissionTypeEnum.Item; });
6898
6904
  return p.length > 0 ? this.getPermissionClass(p[0]) : null;
6899
6905
  };
6900
6906
  BaseComponent.prototype.getPermissionClass = function (p) {
6901
- return new PermissionClass(p.Name, p.Icon, p.Type, p.Area, p.Controller, p.Action, this.getPermissionAccessesClass(p.Id));
6907
+ return new PermissionClass(p.Name, p.Icon, p.Type, p.Area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
6902
6908
  };
6903
6909
  BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
6904
6910
  var _this = this;
@@ -7134,6 +7140,7 @@
7134
7140
  return "continue";
7135
7141
  }
7136
7142
  var opt = new InputClass(this_1.environment, this_1.l, option.Name, option.Icon, exports.InputType.Icon, 'blue h-25 m-h-5 d-ib va-m f-u');
7143
+ console.log(option.Condition, 'option.Condition option.Condition');
7137
7144
  opt.condition = option.Condition;
7138
7145
  if (option.Type === exports.PermissionTypeEnum.OptionLink || option.Type === exports.PermissionTypeEnum.OptionLinkNewTab) {
7139
7146
  var p = new PermissionClass();