ps-toolkit-ui 1.17.85 → 1.17.87

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.
@@ -3516,14 +3516,14 @@
3516
3516
  opt.modal = this_2.table.optionsActions.find(function (x) { return x.name === option.Action; });
3517
3517
  opt.onClick = function () {
3518
3518
  var e_3, _e;
3519
- var _a, _b, _c;
3519
+ var _a;
3520
3520
  if (opt.modal.table) {
3521
3521
  var p = new PermissionClass();
3522
3522
  p.RelatedId = _this.row.Data.Id;
3523
3523
  p.Area = _this.table.permissions.Area;
3524
3524
  p.Controller = _this.table.permissions.Controller;
3525
3525
  p.Action = option.Action;
3526
- p.Accesses = (_b = (_a = _this.row.Options) === null || _a === void 0 ? void 0 : _a.filter(function (x) { return x.ParentId === option.Id; })) !== null && _b !== void 0 ? _b : [];
3526
+ p.Accesses = _this.getPermission(option.Id, _this.row.Options);
3527
3527
  opt.modal.table.permissions = p;
3528
3528
  if (opt.modal.table.form) {
3529
3529
  opt.modal.table.form.url = option.Url.replace('{}', _this.row.Data.Id) + '-insert';
@@ -3543,7 +3543,7 @@
3543
3543
  if (opt.modal.accordion) {
3544
3544
  var _loop_3 = function (r) {
3545
3545
  if (r.table) {
3546
- var options = JSON.parse(JSON.stringify((_c = _this.row.Options) !== null && _c !== void 0 ? _c : []));
3546
+ var options = JSON.parse(JSON.stringify((_a = _this.row.Options) !== null && _a !== void 0 ? _a : []));
3547
3547
  var rowOption_1 = options.find(function (x) { return x.ParentId === option.Id && x.Action === r.name; });
3548
3548
  if (rowOption_1) {
3549
3549
  var p = new PermissionClass();
@@ -3634,6 +3634,12 @@
3634
3634
  // .concat(this.table.permissions.hasAccess('Update') ? [this.optEdit] : [])
3635
3635
  // .concat(this.table.permissions.hasAccess('Delete') ? [this.optDelete] : []);
3636
3636
  };
3637
+ TableRowComponent.prototype.getPermission = function (parentId, list) {
3638
+ var _this = this;
3639
+ var _a;
3640
+ var children = (_a = list === null || list === void 0 ? void 0 : list.filter(function (item) { return item.ParentId === parentId; })) !== null && _a !== void 0 ? _a : [];
3641
+ return children.map(function (child) { return (Object.assign(Object.assign({}, child), { children: _this.getPermission(child.Id, list) })); });
3642
+ };
3637
3643
  TableRowComponent.prototype.getCell = function (col) {
3638
3644
  var e_4, _e;
3639
3645
  // console.log('getCell');