ps-toolkit-ui 0.0.37 → 0.0.41
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.
- package/bundles/ps-toolkit-ui.umd.js +14 -15
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/enum.class.js +8 -7
- package/esm2015/lib/classes/permission.class.js +6 -4
- package/esm2015/lib/classes/table.class.js +1 -2
- package/esm2015/lib/components/base.component.js +2 -2
- package/esm2015/lib/components/table/row/table.row.component.js +1 -4
- package/fesm2015/ps-toolkit-ui.js +13 -14
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/enum.class.d.ts +7 -6
- package/lib/classes/permission.class.d.ts +3 -3
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -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["
|
|
808
|
-
PermissionTypeEnum[PermissionTypeEnum["
|
|
809
|
-
PermissionTypeEnum[PermissionTypeEnum["
|
|
810
|
-
PermissionTypeEnum[PermissionTypeEnum["
|
|
811
|
-
PermissionTypeEnum[PermissionTypeEnum["
|
|
812
|
-
PermissionTypeEnum[PermissionTypeEnum["
|
|
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";
|
|
@@ -2525,9 +2526,6 @@
|
|
|
2525
2526
|
};
|
|
2526
2527
|
TableRowComponent.prototype.getOptions = function () {
|
|
2527
2528
|
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]; }));
|
|
2531
2529
|
return (this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ? [this.addChildren] : [])
|
|
2532
2530
|
.concat(this.table.options.filter(function (x) { return x.condition == null ||
|
|
2533
2531
|
(x.condition.startsWith('!') ? !_this.row[x.condition.substring(1)] : _this.row[x.condition]); }).map(function (o) {
|
|
@@ -5056,14 +5054,14 @@
|
|
|
5056
5054
|
};
|
|
5057
5055
|
|
|
5058
5056
|
var PermissionClass = /** @class */ (function () {
|
|
5059
|
-
function PermissionClass(Name, Icon, Type, Area, Controller, Action,
|
|
5057
|
+
function PermissionClass(Name, Icon, Type, Area, Controller, Action, Condition, Accesses) {
|
|
5060
5058
|
if (Name === void 0) { Name = ''; }
|
|
5061
5059
|
if (Icon === void 0) { Icon = ''; }
|
|
5062
5060
|
if (Type === void 0) { Type = null; }
|
|
5063
5061
|
if (Area === void 0) { Area = ''; }
|
|
5064
5062
|
if (Controller === void 0) { Controller = ''; }
|
|
5065
5063
|
if (Action === void 0) { Action = ''; }
|
|
5066
|
-
if (
|
|
5064
|
+
if (Condition === void 0) { Condition = null; }
|
|
5067
5065
|
if (Accesses === void 0) { Accesses = []; }
|
|
5068
5066
|
this.Name = Name;
|
|
5069
5067
|
this.Icon = Icon;
|
|
@@ -5071,10 +5069,9 @@
|
|
|
5071
5069
|
this.Area = Area;
|
|
5072
5070
|
this.Controller = Controller;
|
|
5073
5071
|
this.Action = Action;
|
|
5074
|
-
this.
|
|
5072
|
+
this.Condition = Condition;
|
|
5075
5073
|
this.Accesses = Accesses;
|
|
5076
5074
|
this.RelatedId = null;
|
|
5077
|
-
this.Condition = null;
|
|
5078
5075
|
}
|
|
5079
5076
|
PermissionClass.prototype.getAccess = function (a) {
|
|
5080
5077
|
var c = this.Accesses.filter(function (x) { return x.Action === a && x.Type === exports.PermissionTypeEnum.Access; });
|
|
@@ -5089,6 +5086,9 @@
|
|
|
5089
5086
|
PermissionClass.prototype.getOptions = function () {
|
|
5090
5087
|
return this.Accesses.filter(function (x) { return x.Type !== exports.PermissionTypeEnum.Access; });
|
|
5091
5088
|
};
|
|
5089
|
+
PermissionClass.prototype.getOption = function (a) {
|
|
5090
|
+
return this.Accesses.filter(function (x) { return x.Action === a && x.Type !== exports.PermissionTypeEnum.Access; });
|
|
5091
|
+
};
|
|
5092
5092
|
PermissionClass.prototype.getUrl = function () {
|
|
5093
5093
|
return (this.Area ? '/' + this.Area : '') + '/' + this.Controller + '/' +
|
|
5094
5094
|
(this.RelatedId ? this.RelatedId + "/" : '') +
|
|
@@ -6904,7 +6904,7 @@
|
|
|
6904
6904
|
return p.length > 0 ? this.getPermissionClass(p[0]) : null;
|
|
6905
6905
|
};
|
|
6906
6906
|
BaseComponent.prototype.getPermissionClass = function (p) {
|
|
6907
|
-
return new PermissionClass(p.Name, p.Icon, p.Type,
|
|
6907
|
+
return new PermissionClass(p.Name, p.Icon, p.Type, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
|
|
6908
6908
|
};
|
|
6909
6909
|
BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
|
|
6910
6910
|
var _this = this;
|
|
@@ -7140,7 +7140,6 @@
|
|
|
7140
7140
|
return "continue";
|
|
7141
7141
|
}
|
|
7142
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');
|
|
7144
7143
|
opt.condition = option.Condition;
|
|
7145
7144
|
if (option.Type === exports.PermissionTypeEnum.OptionLink || option.Type === exports.PermissionTypeEnum.OptionLinkNewTab) {
|
|
7146
7145
|
var p = new PermissionClass();
|