ps-toolkit-ui 0.0.131 → 0.0.132
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 +15 -4
- 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 -1
- package/esm2015/lib/classes/permission.class.js +6 -4
- package/esm2015/lib/components/base.component.js +2 -2
- package/fesm2015/ps-toolkit-ui.js +14 -5
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/enum.class.d.ts +6 -0
- package/lib/classes/permission.class.d.ts +4 -3
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -809,6 +809,12 @@
|
|
|
809
809
|
PermissionTypeEnum[PermissionTypeEnum["Access"] = 1] = "Access";
|
|
810
810
|
PermissionTypeEnum[PermissionTypeEnum["Option"] = 2] = "Option";
|
|
811
811
|
})(exports.PermissionTypeEnum || (exports.PermissionTypeEnum = {}));
|
|
812
|
+
(function (PermissionAccessTypeEnum) {
|
|
813
|
+
PermissionAccessTypeEnum[PermissionAccessTypeEnum["List"] = 1] = "List";
|
|
814
|
+
PermissionAccessTypeEnum[PermissionAccessTypeEnum["Insert"] = 2] = "Insert";
|
|
815
|
+
PermissionAccessTypeEnum[PermissionAccessTypeEnum["Update"] = 3] = "Update";
|
|
816
|
+
PermissionAccessTypeEnum[PermissionAccessTypeEnum["Delete"] = 4] = "Delete";
|
|
817
|
+
})(exports.PermissionAccessTypeEnum || (exports.PermissionAccessTypeEnum = {}));
|
|
812
818
|
(function (PermissionInputActionEnum) {
|
|
813
819
|
PermissionInputActionEnum[PermissionInputActionEnum["None"] = 0] = "None";
|
|
814
820
|
PermissionInputActionEnum[PermissionInputActionEnum["Link"] = 1] = "Link";
|
|
@@ -2392,11 +2398,12 @@
|
|
|
2392
2398
|
};
|
|
2393
2399
|
|
|
2394
2400
|
var PermissionClass = /** @class */ (function () {
|
|
2395
|
-
function PermissionClass(Name, Icon, Type, InputType, InputAction, Area, Controller, Action, Condition, Accesses) {
|
|
2401
|
+
function PermissionClass(Name, Icon, Type, InputType, AccessType, InputAction, Area, Controller, Action, Condition, Accesses) {
|
|
2396
2402
|
if (Name === void 0) { Name = ''; }
|
|
2397
2403
|
if (Icon === void 0) { Icon = ''; }
|
|
2398
2404
|
if (Type === void 0) { Type = null; }
|
|
2399
2405
|
if (InputType === void 0) { InputType = null; }
|
|
2406
|
+
if (AccessType === void 0) { AccessType = null; }
|
|
2400
2407
|
if (InputAction === void 0) { InputAction = null; }
|
|
2401
2408
|
if (Area === void 0) { Area = ''; }
|
|
2402
2409
|
if (Controller === void 0) { Controller = ''; }
|
|
@@ -2407,6 +2414,7 @@
|
|
|
2407
2414
|
this.Icon = Icon;
|
|
2408
2415
|
this.Type = Type;
|
|
2409
2416
|
this.InputType = InputType;
|
|
2417
|
+
this.AccessType = AccessType;
|
|
2410
2418
|
this.InputAction = InputAction;
|
|
2411
2419
|
this.Area = Area;
|
|
2412
2420
|
this.Controller = Controller;
|
|
@@ -2416,8 +2424,11 @@
|
|
|
2416
2424
|
this.RelatedId = null;
|
|
2417
2425
|
this.OnClick = null;
|
|
2418
2426
|
}
|
|
2419
|
-
PermissionClass.prototype.getAccess = function (a) {
|
|
2420
|
-
|
|
2427
|
+
PermissionClass.prototype.getAccess = function (a, at) {
|
|
2428
|
+
if (a === void 0) { a = null; }
|
|
2429
|
+
if (at === void 0) { at = null; }
|
|
2430
|
+
var c = this.Accesses.filter(function (x) { return ((a != null && x.Action === a) || (at != null && x.AccessType === at)) &&
|
|
2431
|
+
x.Type === exports.PermissionTypeEnum.Access; });
|
|
2421
2432
|
return c.length > 0 ? c[0] : null;
|
|
2422
2433
|
};
|
|
2423
2434
|
PermissionClass.prototype.hasAccess = function (a) {
|
|
@@ -7047,7 +7058,7 @@
|
|
|
7047
7058
|
return p.length > 0 ? this.getPermissionClass(p[0]) : null;
|
|
7048
7059
|
};
|
|
7049
7060
|
BaseComponent.prototype.getPermissionClass = function (p) {
|
|
7050
|
-
return new PermissionClass(p.Name, p.Icon, p.Type, p.InputType, p.InputAction, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
|
|
7061
|
+
return new PermissionClass(p.Name, p.Icon, p.Type, p.InputType, p.AccessType, p.InputAction, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
|
|
7051
7062
|
};
|
|
7052
7063
|
BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
|
|
7053
7064
|
var _this = this;
|