ps-toolkit-ui 0.0.94 → 0.0.95
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 +9 -6
- 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 +6 -1
- package/esm2015/lib/classes/permission.class.js +3 -2
- package/esm2015/lib/classes/table.class.js +3 -3
- package/esm2015/lib/components/base.component.js +2 -2
- package/esm2015/lib/components/sidebar/sidebar.component.js +1 -4
- package/fesm2015/ps-toolkit-ui.js +10 -7
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/enum.class.d.ts +4 -0
- package/lib/classes/permission.class.d.ts +3 -2
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -812,6 +812,10 @@
|
|
|
812
812
|
PermissionTypeEnum[PermissionTypeEnum["OptionModal"] = 7] = "OptionModal";
|
|
813
813
|
PermissionTypeEnum[PermissionTypeEnum["OptionConfirm"] = 8] = "OptionConfirm";
|
|
814
814
|
})(exports.PermissionTypeEnum || (exports.PermissionTypeEnum = {}));
|
|
815
|
+
(function (PermissionOptionTypeEnum) {
|
|
816
|
+
PermissionOptionTypeEnum[PermissionOptionTypeEnum["Icon"] = 0] = "Icon";
|
|
817
|
+
PermissionOptionTypeEnum[PermissionOptionTypeEnum["Button"] = 1] = "Button";
|
|
818
|
+
})(exports.PermissionOptionTypeEnum || (exports.PermissionOptionTypeEnum = {}));
|
|
815
819
|
(function (VehicleType) {
|
|
816
820
|
VehicleType[VehicleType["Car"] = 1] = "Car";
|
|
817
821
|
VehicleType[VehicleType["Motorcycle"] = 2] = "Motorcycle";
|
|
@@ -2152,10 +2156,7 @@
|
|
|
2152
2156
|
this.currentSidebar = this.getSidebarActive(this.sidebar, active);
|
|
2153
2157
|
};
|
|
2154
2158
|
SidebarComponent.prototype.ngOnInit = function () {
|
|
2155
|
-
console.log(this.permissions, 'this.permissions');
|
|
2156
|
-
console.log(this.permissions.filter(function (x) { return x.Type === exports.PermissionTypeEnum.Item; }), 'this.permissions.filter(x => x.Type === PermissionTypeEnum.Item)');
|
|
2157
2159
|
this.sidebar = this.getSidebar();
|
|
2158
|
-
console.log(this.sidebar, 'this.sidebar');
|
|
2159
2160
|
this.setActive();
|
|
2160
2161
|
};
|
|
2161
2162
|
SidebarComponent.prototype.getSidebar = function (parentId) {
|
|
@@ -5082,10 +5083,11 @@
|
|
|
5082
5083
|
};
|
|
5083
5084
|
|
|
5084
5085
|
var PermissionClass = /** @class */ (function () {
|
|
5085
|
-
function PermissionClass(Name, Icon, Type, Area, Controller, Action, Condition, Accesses) {
|
|
5086
|
+
function PermissionClass(Name, Icon, Type, OptionType, Area, Controller, Action, Condition, Accesses) {
|
|
5086
5087
|
if (Name === void 0) { Name = ''; }
|
|
5087
5088
|
if (Icon === void 0) { Icon = ''; }
|
|
5088
5089
|
if (Type === void 0) { Type = null; }
|
|
5090
|
+
if (OptionType === void 0) { OptionType = null; }
|
|
5089
5091
|
if (Area === void 0) { Area = ''; }
|
|
5090
5092
|
if (Controller === void 0) { Controller = ''; }
|
|
5091
5093
|
if (Action === void 0) { Action = ''; }
|
|
@@ -5094,6 +5096,7 @@
|
|
|
5094
5096
|
this.Name = Name;
|
|
5095
5097
|
this.Icon = Icon;
|
|
5096
5098
|
this.Type = Type;
|
|
5099
|
+
this.OptionType = OptionType;
|
|
5097
5100
|
this.Area = Area;
|
|
5098
5101
|
this.Controller = Controller;
|
|
5099
5102
|
this.Action = Action;
|
|
@@ -6953,7 +6956,7 @@
|
|
|
6953
6956
|
return p.length > 0 ? this.getPermissionClass(p[0]) : null;
|
|
6954
6957
|
};
|
|
6955
6958
|
BaseComponent.prototype.getPermissionClass = function (p) {
|
|
6956
|
-
return new PermissionClass(p.Name, p.Icon, p.Type, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
|
|
6959
|
+
return new PermissionClass(p.Name, p.Icon, p.Type, p.OptionType, this.app.area, p.Controller, p.Action, p.Condition, this.getPermissionAccessesClass(p.Id));
|
|
6957
6960
|
};
|
|
6958
6961
|
BaseComponent.prototype.getPermissionAccessesClass = function (parentId) {
|
|
6959
6962
|
var _this = this;
|
|
@@ -7188,7 +7191,7 @@
|
|
|
7188
7191
|
if (this_1.options.filter(function (x) { return x.name === option.Name; }).length > 0) {
|
|
7189
7192
|
return "continue";
|
|
7190
7193
|
}
|
|
7191
|
-
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');
|
|
7194
|
+
var opt = new InputClass(this_1.environment, this_1.l, option.Name, option.Icon, option.OptionType === exports.PermissionOptionTypeEnum.Icon ? exports.InputType.Icon : exports.InputType.Button, 'blue h-25 m-h-5 d-ib va-m f-u');
|
|
7192
7195
|
opt.condition = option.Condition;
|
|
7193
7196
|
if (option.Type === exports.PermissionTypeEnum.OptionLink || option.Type === exports.PermissionTypeEnum.OptionLinkNewTab) {
|
|
7194
7197
|
var p = new PermissionClass();
|