ps-toolkit-ui 0.0.39 → 0.0.43

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.
@@ -804,12 +804,13 @@
804
804
  PermissionTypeEnum[PermissionTypeEnum["Form"] = -1] = "Form";
805
805
  PermissionTypeEnum[PermissionTypeEnum["Item"] = 0] = "Item";
806
806
  PermissionTypeEnum[PermissionTypeEnum["Access"] = 1] = "Access";
807
- PermissionTypeEnum[PermissionTypeEnum["OptionLink"] = 2] = "OptionLink";
808
- PermissionTypeEnum[PermissionTypeEnum["OptionLinkNewTab"] = 3] = "OptionLinkNewTab";
809
- PermissionTypeEnum[PermissionTypeEnum["OptionReport"] = 4] = "OptionReport";
810
- PermissionTypeEnum[PermissionTypeEnum["OptionFile"] = 5] = "OptionFile";
811
- PermissionTypeEnum[PermissionTypeEnum["OptionModal"] = 6] = "OptionModal";
812
- PermissionTypeEnum[PermissionTypeEnum["OptionConfirm"] = 7] = "OptionConfirm";
807
+ PermissionTypeEnum[PermissionTypeEnum["OptionIcon"] = 2] = "OptionIcon";
808
+ PermissionTypeEnum[PermissionTypeEnum["OptionLink"] = 3] = "OptionLink";
809
+ PermissionTypeEnum[PermissionTypeEnum["OptionLinkNewTab"] = 4] = "OptionLinkNewTab";
810
+ PermissionTypeEnum[PermissionTypeEnum["OptionReport"] = 5] = "OptionReport";
811
+ PermissionTypeEnum[PermissionTypeEnum["OptionFile"] = 6] = "OptionFile";
812
+ PermissionTypeEnum[PermissionTypeEnum["OptionModal"] = 7] = "OptionModal";
813
+ PermissionTypeEnum[PermissionTypeEnum["OptionConfirm"] = 8] = "OptionConfirm";
813
814
  })(exports.PermissionTypeEnum || (exports.PermissionTypeEnum = {}));
814
815
  (function (VehicleType) {
815
816
  VehicleType[VehicleType["Car"] = 1] = "Car";
@@ -5071,6 +5072,7 @@
5071
5072
  this.Condition = Condition;
5072
5073
  this.Accesses = Accesses;
5073
5074
  this.RelatedId = null;
5075
+ this.OnClick = null;
5074
5076
  }
5075
5077
  PermissionClass.prototype.getAccess = function (a) {
5076
5078
  var c = this.Accesses.filter(function (x) { return x.Action === a && x.Type === exports.PermissionTypeEnum.Access; });
@@ -5085,6 +5087,10 @@
5085
5087
  PermissionClass.prototype.getOptions = function () {
5086
5088
  return this.Accesses.filter(function (x) { return x.Type !== exports.PermissionTypeEnum.Access; });
5087
5089
  };
5090
+ PermissionClass.prototype.getOption = function (a) {
5091
+ var c = this.Accesses.filter(function (x) { return x.Action === a && x.Type !== exports.PermissionTypeEnum.Access; });
5092
+ return c.length > 0 ? c[0] : null;
5093
+ };
5088
5094
  PermissionClass.prototype.getUrl = function () {
5089
5095
  return (this.Area ? '/' + this.Area : '') + '/' + this.Controller + '/' +
5090
5096
  (this.RelatedId ? this.RelatedId + "/" : '') +
@@ -7232,6 +7238,11 @@
7232
7238
  });
7233
7239
  };
7234
7240
  }
7241
+ else if (option.Type === exports.PermissionTypeEnum.OptionIcon && option.OnClick) {
7242
+ opt.onClick = function (btn) {
7243
+ option.OnClick(btn);
7244
+ };
7245
+ }
7235
7246
  this_1.options.push(opt);
7236
7247
  };
7237
7248
  var this_1 = this;