ps-toolkit-ui 1.4.5 → 1.4.8
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 +17 -12
- 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/lang.class.js +4 -1
- package/esm2015/lib/classes/permission.class.js +3 -2
- package/esm2015/lib/components/alert/alert.component.js +2 -2
- package/esm2015/lib/components/base.component.js +2 -2
- package/esm2015/lib/components/calendar/calendar.component.js +2 -2
- package/esm2015/lib/components/confirm/confirm.component.js +2 -2
- package/esm2015/lib/components/footer/footer.component.js +2 -2
- package/esm2015/lib/components/header/header.component.js +2 -2
- package/esm2015/lib/components/loading/loading.component.js +2 -2
- package/esm2015/lib/components/notfound/notfound.component.js +2 -2
- package/esm2015/lib/components/sidebar/item/sidebar.item.component.js +3 -3
- package/esm2015/lib/components/sidebar/sidebar.component.js +2 -2
- package/fesm2015/ps-toolkit-ui.js +16 -12
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/permission.class.d.ts +2 -1
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -300,6 +300,7 @@ class LangClass {
|
|
|
300
300
|
}
|
|
301
301
|
get(area, c, k, v = null) {
|
|
302
302
|
if (k != null && (/^-?\d+$/.test(k) || /^\d+\.\d+$/.test(k))) {
|
|
303
|
+
console.log(area, c, k, v, '=>', k);
|
|
303
304
|
return k;
|
|
304
305
|
}
|
|
305
306
|
let cv = get(this.lang, area ? `${area}.${c}.${k}` : `${c}.${k}`);
|
|
@@ -310,6 +311,7 @@ class LangClass {
|
|
|
310
311
|
cv = get(this.lang, `public.${k}`);
|
|
311
312
|
}
|
|
312
313
|
if (!cv) {
|
|
314
|
+
console.log(area, c, k, v, '=>', k);
|
|
313
315
|
return k;
|
|
314
316
|
}
|
|
315
317
|
if (v !== null) {
|
|
@@ -322,6 +324,7 @@ class LangClass {
|
|
|
322
324
|
cv = cv.replace('{}', this.get(area, c, v, null));
|
|
323
325
|
}
|
|
324
326
|
}
|
|
327
|
+
console.log(area, c, k, v, '=>', cv);
|
|
325
328
|
return cv;
|
|
326
329
|
}
|
|
327
330
|
}
|
|
@@ -331,7 +334,7 @@ class FooterComponent {
|
|
|
331
334
|
this.config = config;
|
|
332
335
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
333
336
|
this.l = (key, v = null) => {
|
|
334
|
-
return lang.get('
|
|
337
|
+
return lang.get('Public', 'Footer', key, v);
|
|
335
338
|
};
|
|
336
339
|
}
|
|
337
340
|
}
|
|
@@ -1517,7 +1520,7 @@ class HeaderComponent {
|
|
|
1517
1520
|
this.logout = new EventEmitter();
|
|
1518
1521
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
1519
1522
|
const l = (key, v = null) => {
|
|
1520
|
-
return lang.get('
|
|
1523
|
+
return lang.get('Public', 'Header', key, v);
|
|
1521
1524
|
};
|
|
1522
1525
|
this.logoutInp = new InputClass(config.environment, l, 'Logout', 'fa-duotone fa-right-from-bracket', InputType.Button, 'grey h-30 p-0');
|
|
1523
1526
|
this.logoutInp.onClick = () => {
|
|
@@ -1569,7 +1572,7 @@ class SidebarItemComponent {
|
|
|
1569
1572
|
this.config = config;
|
|
1570
1573
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
1571
1574
|
this.l = (key, v = null) => {
|
|
1572
|
-
return lang.get('
|
|
1575
|
+
return lang.get('Public', 'Sidebar', key, v);
|
|
1573
1576
|
};
|
|
1574
1577
|
}
|
|
1575
1578
|
openClose(e) {
|
|
@@ -1601,7 +1604,7 @@ class SidebarItemComponent {
|
|
|
1601
1604
|
SidebarItemComponent.decorators = [
|
|
1602
1605
|
{ type: Component, args: [{
|
|
1603
1606
|
selector: 'lib-sidebar-item',
|
|
1604
|
-
template: "<div [className]=\"(isActive(item) ? 'parent-active open ' : '') + 'user-sidebar-item'\">\r\n <a (click)=\"closeSidebar()\" [style]=\"{paddingRight: (i * 25) + 'px'}\" *ngIf=\"item.children.length == 0\" [className]=\"(currentSidebar && item.name == currentSidebar.name ? 'active ' : '') + 'content'\" [routerLink]=\"item.url\">\r\n <i [className]=\"item.icon + ' icon'\"></i>\r\n <div class=\"title\">{{ l(item.name) }}</div>\r\n </a>\r\n <div [style]=\"{paddingRight: (i * 25) + 'px'}\" *ngIf=\"item.children.length > 0\" (click)=\"openClose($event)\" class=\"content parent\">\r\n <i [className]=\"item.icon + ' icon'\"></i>\r\n <div class=\"title\">{{ l(item.name) }}</div>\r\n <i [className]=\"'fa-duotone fa-angle-left arrow'\"></i>\r\n </div>\r\n <div *ngIf=\"item.children.length > 0\" class=\"children\">\r\n <div class=\"items\">\r\n <lib-sidebar-item [i]=\"i + 1\" [item]=\"child\" [currentSidebar]=\"currentSidebar\" *ngFor=\"let child of item.children\"></lib-sidebar-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
1607
|
+
template: "<div [className]=\"(isActive(item) ? 'parent-active open ' : '') + 'user-sidebar-item'\">\r\n <a (click)=\"closeSidebar()\" [style]=\"{paddingRight: (i * 25) + 'px'}\" *ngIf=\"item.children.length == 0\" [className]=\"(currentSidebar && item.name == currentSidebar.name ? 'active ' : '') + 'content'\" [routerLink]=\"item.url.includes('/home/index') ? '' : item.url\">\r\n <i [className]=\"item.icon + ' icon'\"></i>\r\n <div class=\"title\">{{ l(item.name) }}</div>\r\n </a>\r\n <div [style]=\"{paddingRight: (i * 25) + 'px'}\" *ngIf=\"item.children.length > 0\" (click)=\"openClose($event)\" class=\"content parent\">\r\n <i [className]=\"item.icon + ' icon'\"></i>\r\n <div class=\"title\">{{ l(item.name) }}</div>\r\n <i [className]=\"'fa-duotone fa-angle-left arrow'\"></i>\r\n </div>\r\n <div *ngIf=\"item.children.length > 0\" class=\"children\">\r\n <div class=\"items\">\r\n <lib-sidebar-item [i]=\"i + 1\" [item]=\"child\" [currentSidebar]=\"currentSidebar\" *ngFor=\"let child of item.children\"></lib-sidebar-item>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
1605
1608
|
styles: [".user-sidebar-item{float:left;position:relative;text-align:center;width:100%}.user-sidebar-item .content{align-items:center;cursor:pointer;direction:rtl;display:flex;float:right;justify-content:right;position:relative;transition:all .3s;width:100%}.user-sidebar-item .dot{background-color:var(--base);border:2px solid hsla(0,0%,93.3%,.4);border-radius:50%;height:10px;position:absolute;right:-15px;top:15px;width:10px;z-index:2}.user-sidebar-item .dot.active{background-color:var(--base-white);border:2px solid var(--base-white)}.user-sidebar-item.parent-active>.dot.parent{background-color:hsla(0,0%,93.3%,.4);border:none}.user-sidebar-item .dot.back{background-color:var(--base);border:none;z-index:1}.user-sidebar-item .children{display:none;float:left;position:relative;width:100%}.user-sidebar-item .children .items{float:left;width:100%}.user-sidebar-item .children .line{background-color:hsla(0,0%,93.3%,.4);height:calc(100% - 20px);left:calc(85% + 10px);position:absolute;top:0;width:1px}.user-sidebar-item .content .title{color:hsla(0,0%,100%,.8);float:right;font-family:VazirLight;font-size:12px;height:45px;line-height:45px;overflow:hidden;transition:all .3s;width:0}.user-sidebar-item .content .icon{color:hsla(0,0%,100%,.6666666666666666);float:right;font-size:18px;height:45px;line-height:45px;transition:all .3s;width:100%}.user-sidebar-item .content .arrow{color:hsla(0,0%,100%,.8);font-size:13px;height:45px;line-height:45px;overflow:hidden;text-align:center;transition:all .3s;width:0}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.close .user-sidebar-item .content{padding:0!important}.user-sidebar-item.open .content .arrow{transform:rotate(-90deg)}.user-sidebar-item>.children .content .icon{font-size:11px}.user-sidebar-item.parent-active>.content,.user-sidebar-item:hover>.content{background-color:var(--base-dark)}.user-sidebar-item.parent-active>.content .title,.user-sidebar-item:hover>.content .title{color:#fff;font-family:VazirBold}.user-sidebar-item.parent-active>.content .icon,.user-sidebar-item:hover>.content .icon{color:var(--primary)}.user-sidebar-item.parent-active>.content .arrow,.user-sidebar-item:hover>.content .arrow{color:#fff}.user-sidebar-item.parent-active>.children{display:block}@media (max-width:399.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:400px) and (max-width:499.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:500px) and (max-width:599.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:600px) and (max-width:699.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:700px) and (max-width:799.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:800px) and (max-width:899.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:900px) and (max-width:999.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:1000px) and (max-width:1099.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}@media (min-width:1100px) and (max-width:1199.98px){::ng-deep #Sidebar .user-sidebar-item .content .title{width:calc(100% - 100px)}::ng-deep #Sidebar.open .user-sidebar-item .content .title{width:0}::ng-deep #Sidebar .user-sidebar-item .content .icon{width:70px}::ng-deep #Sidebar.open .user-sidebar-item .content .icon{width:100%}::ng-deep #Sidebar .user-sidebar-item .content .arrow{width:30px}::ng-deep #Sidebar.open .user-sidebar-item .content .arrow{width:0}}"]
|
|
1606
1609
|
},] }
|
|
1607
1610
|
];
|
|
@@ -1637,7 +1640,7 @@ class SidebarComponent {
|
|
|
1637
1640
|
this.sidebar = [];
|
|
1638
1641
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
1639
1642
|
this.l = (key, v = null) => {
|
|
1640
|
-
return lang.get('
|
|
1643
|
+
return lang.get('Public', 'Sidebar', key, v);
|
|
1641
1644
|
};
|
|
1642
1645
|
router.events.subscribe(event => {
|
|
1643
1646
|
if (event instanceof NavigationEnd) {
|
|
@@ -1849,7 +1852,7 @@ TablePaginationComponent.propDecorators = {
|
|
|
1849
1852
|
};
|
|
1850
1853
|
|
|
1851
1854
|
class PermissionClass {
|
|
1852
|
-
constructor(Name = '', Icon = '', Type = null, InputType = null, AccessType = null, InputAction = null, Area = '', Controller = '', Action = '', Condition = null, Accesses = []) {
|
|
1855
|
+
constructor(Name = '', Icon = '', Type = null, InputType = null, AccessType = null, InputAction = null, Area = '', Controller = '', Action = '', Url = '', Condition = null, Accesses = []) {
|
|
1853
1856
|
this.Name = Name;
|
|
1854
1857
|
this.Icon = Icon;
|
|
1855
1858
|
this.Type = Type;
|
|
@@ -1859,6 +1862,7 @@ class PermissionClass {
|
|
|
1859
1862
|
this.Area = Area;
|
|
1860
1863
|
this.Controller = Controller;
|
|
1861
1864
|
this.Action = Action;
|
|
1865
|
+
this.Url = Url;
|
|
1862
1866
|
this.Condition = Condition;
|
|
1863
1867
|
this.Accesses = Accesses;
|
|
1864
1868
|
this.RelatedId = null;
|
|
@@ -5374,7 +5378,7 @@ class AlertComponent {
|
|
|
5374
5378
|
this.config = config;
|
|
5375
5379
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
5376
5380
|
const l = (key, v = null) => {
|
|
5377
|
-
return lang.get('
|
|
5381
|
+
return lang.get('Public', 'Alert', key, v);
|
|
5378
5382
|
};
|
|
5379
5383
|
this.alert = new ModalClass(config.environment, l, 'Alert');
|
|
5380
5384
|
this.alert.form = new FormClass(config.environment, l, 'Alert');
|
|
@@ -5407,7 +5411,7 @@ class ConfirmComponent {
|
|
|
5407
5411
|
this.config = config;
|
|
5408
5412
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
5409
5413
|
this.l = (key, v = null) => {
|
|
5410
|
-
return lang.get('
|
|
5414
|
+
return lang.get('Public', 'Confirm', key, v);
|
|
5411
5415
|
};
|
|
5412
5416
|
}
|
|
5413
5417
|
ngOnInit() {
|
|
@@ -5451,7 +5455,7 @@ class NotfoundComponent {
|
|
|
5451
5455
|
this.config = config;
|
|
5452
5456
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
5453
5457
|
this.l = (key, v = null) => {
|
|
5454
|
-
return lang.get('
|
|
5458
|
+
return lang.get('Public', 'Notfound', key, v);
|
|
5455
5459
|
};
|
|
5456
5460
|
this.back = new InputClass(config.environment, this.l, 'Back', 'fa-duotone fa-arrow-right', InputType.Button, '');
|
|
5457
5461
|
this.back.onClick = () => {
|
|
@@ -6077,7 +6081,7 @@ class LoadingComponent {
|
|
|
6077
6081
|
constructor(config) {
|
|
6078
6082
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
6079
6083
|
this.l = (key, v = null) => {
|
|
6080
|
-
return lang.get('
|
|
6084
|
+
return lang.get('Public', null, key, v);
|
|
6081
6085
|
};
|
|
6082
6086
|
}
|
|
6083
6087
|
}
|
|
@@ -6163,7 +6167,7 @@ class CalendarComponent {
|
|
|
6163
6167
|
this.days = [];
|
|
6164
6168
|
const lang = new LangClass(config.currentLang, config.strings);
|
|
6165
6169
|
this.l = (key, v = null) => {
|
|
6166
|
-
return lang.get('
|
|
6170
|
+
return lang.get('Public', null, key, v);
|
|
6167
6171
|
};
|
|
6168
6172
|
this.months = [this.l('Month1'), this.l('Month2'), this.l('Month3'), this.l('Month4'), this.l('Month5'), this.l('Month6'), this.l('Month7'), this.l('Month8'), this.l('Month9'), this.l('Month10'), this.l('Month11'), this.l('Month12')];
|
|
6169
6173
|
this.setActive(moment());
|
|
@@ -6367,7 +6371,7 @@ class BaseComponent {
|
|
|
6367
6371
|
return p.length > 0 ? this.getPermissionClass(p[0]) : null;
|
|
6368
6372
|
}
|
|
6369
6373
|
getPermissionClass(p) {
|
|
6370
|
-
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));
|
|
6374
|
+
return new PermissionClass(p.Name, p.Icon, p.Type, p.InputType, p.AccessType, p.InputAction, this.app.area, p.Controller, p.Action, p.Url, p.Condition, this.getPermissionAccessesClass(p.Id));
|
|
6371
6375
|
}
|
|
6372
6376
|
getPermissionAccessesClass(parentId) {
|
|
6373
6377
|
return this.app.currentData.permissions.filter(x => x.ParentId === parentId).map(x => this.getPermissionClass(x));
|