iptdevs-design-system 2.6.44 → 2.6.46
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/esm2020/lib/components/molecules/sidenav/sidenav.component.mjs +17 -13
- package/esm2020/lib/core/utils/base-service/base.service.mjs +9 -6
- package/fesm2015/iptdevs-design-system.mjs +21 -14
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +21 -14
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/components/molecules/sidenav/sidenav.component.d.ts +4 -1
- package/package.json +1 -1
|
@@ -10,11 +10,12 @@ import Swal from 'sweetalert2';
|
|
|
10
10
|
import * as i1$2 from '@angular/common/http';
|
|
11
11
|
import { HttpHeaders } from '@angular/common/http';
|
|
12
12
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i2 from 'design-system/src/public-api';
|
|
14
|
+
import * as i4 from '@angular/material/sidenav';
|
|
14
15
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
15
|
-
import * as
|
|
16
|
+
import * as i5 from '@angular/material/toolbar';
|
|
16
17
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
17
|
-
import * as
|
|
18
|
+
import * as i6 from '@angular/material/list';
|
|
18
19
|
import { MatListModule } from '@angular/material/list';
|
|
19
20
|
import { MatIconModule } from '@angular/material/icon';
|
|
20
21
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -890,15 +891,18 @@ class BaseService {
|
|
|
890
891
|
};
|
|
891
892
|
let service = this.userService;
|
|
892
893
|
let storage = this.storageService;
|
|
894
|
+
let appUser = this.isAnAppUser();
|
|
893
895
|
return new Promise(function (resolve, reject) {
|
|
894
896
|
service.login(request).subscribe(response => {
|
|
895
897
|
switch (response.message.code) {
|
|
896
898
|
case 1:
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
899
|
+
if (!appUser) {
|
|
900
|
+
Swal.fire({
|
|
901
|
+
'title': '<p style="font-family: Poppins"">Perfect!</p>',
|
|
902
|
+
'html': '<p style="font-family: Poppins"">Succesfull login</p>',
|
|
903
|
+
'icon': 'success',
|
|
904
|
+
});
|
|
905
|
+
}
|
|
902
906
|
const loginRegisterUser = {
|
|
903
907
|
token: response.data.token,
|
|
904
908
|
user: response.data,
|
|
@@ -1469,10 +1473,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
1469
1473
|
}] } });
|
|
1470
1474
|
|
|
1471
1475
|
class SidenavComponent {
|
|
1472
|
-
constructor(userService, storageService) {
|
|
1476
|
+
constructor(userService, baseService, storageService) {
|
|
1473
1477
|
this.userService = userService;
|
|
1478
|
+
this.baseService = baseService;
|
|
1474
1479
|
this.storageService = storageService;
|
|
1475
1480
|
this.pageChangeEvent = new EventEmitter();
|
|
1481
|
+
this.appUser = false;
|
|
1476
1482
|
this.routes = [];
|
|
1477
1483
|
this.options = { weekday: 'long', month: 'long', day: 'numeric' };
|
|
1478
1484
|
this.currentDay = new Date().toLocaleDateString('en-EN', this.options);
|
|
@@ -1487,6 +1493,7 @@ class SidenavComponent {
|
|
|
1487
1493
|
this.userService.getRoutesForRole(request).subscribe((response) => {
|
|
1488
1494
|
this.routes = response.data;
|
|
1489
1495
|
});
|
|
1496
|
+
this.appUser = this.baseService.isAnAppUser();
|
|
1490
1497
|
}
|
|
1491
1498
|
clickPage(event) {
|
|
1492
1499
|
this.pageChangeEvent.emit(event);
|
|
@@ -1496,7 +1503,7 @@ class SidenavComponent {
|
|
|
1496
1503
|
this.pageChangeEvent.emit('logout');
|
|
1497
1504
|
}
|
|
1498
1505
|
}
|
|
1499
|
-
SidenavComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: SidenavComponent, deps: [{ token: UserService }, { token: StorageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1506
|
+
SidenavComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: SidenavComponent, deps: [{ token: UserService }, { token: i2.BaseService }, { token: StorageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1500
1507
|
SidenavComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: SidenavComponent, selector: "ipt-sidenav", inputs: { department: "department", setPage: "setPage", userName: "userName" }, outputs: { pageChangeEvent: "pageChangeEvent" }, ngImport: i0, template: `
|
|
1501
1508
|
<mat-sidenav #sidenav mode="push" >
|
|
1502
1509
|
<mat-toolbar color="primary" (click)="sidenav.toggle()">
|
|
@@ -1539,12 +1546,12 @@ SidenavComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
1539
1546
|
</p>
|
|
1540
1547
|
</div>
|
|
1541
1548
|
|
|
1542
|
-
<div class="logout-container" (click)="logout()">
|
|
1549
|
+
<div *ngIf="!this.appUser" class="logout-container" (click)="logout()">
|
|
1543
1550
|
<p class="logout-button">Cerrar sesión</p>
|
|
1544
1551
|
<div class="photo-logout"></div>
|
|
1545
1552
|
</div>
|
|
1546
1553
|
</mat-toolbar>
|
|
1547
|
-
`, isInline: true, styles: ["*{font-family:Poppins,sans-serif}@media screen and (min-width: 320px){.header{background-color:#fff;display:flex;justify-content:space-between;filter:drop-shadow(0px -1px 7px #000)}mat-sidenav{width:-moz-fit-content!important;width:fit-content!important;background-color:#1c77f7!important}.img-logo,.text-container{display:none}.mat-toolbar.mat-primary{background-color:#fff!important;color:#003d99!important;filter:drop-shadow(0px -1px 7px #000)}.logout-container{box-shadow:#11111a1a 0 8px 24px,#11111a1a 0 16px 56px,#11111a1a 0 24px 80px;height:35px;width:auto;border-radius:30px;display:flex;margin-left:10px}.logout-button{display:flex;align-items:center;color:#1c77f7;font-weight:500;font-size:16px;margin-left:20px;text-align:center;width:150px}.photo-logout{background:url(http://qa.iptdev.com.co/assets/icons/exit.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat}.menu-icon{background:url(http://qa.iptdev.com.co/assets/icons/icon-menu.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat}.menu-icon-close{background:url(http://qa.iptdev.com.co/assets/icons/cruz.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat;width:35px;height:35px}.menu-container{box-shadow:#11111a1a 0 8px 24px,#11111a1a 0 16px 56px,#11111a1a 0 24px 80px;height:35px;width:52.5px;width:auto;border-radius:30px;display:flex}.menu-container:hover{cursor:pointer}.menu-container p{width:85px;display:flex;align-items:center;color:#1c77f7;font-weight:500;font-size:16px;margin:0 0 0 15px;text-align:center}}@media screen and (min-width: 768px){.img-logo{display:flex;width:120px;height:60px}.text-container{border-radius:40px;height:45px;width:100%;display:flex;gap:-100px;justify-content:center;flex-direction:column;align-items:flex-start}}.p1{color:gray;margin-left:30px;font-size:13px;height:20px}.p2{margin-left:30px;font-size:14px;font-weight:600;color:#1c77f7}.flex-container-menu{font-size:18px;color:#fff!important}.mat-nav-list{padding:0}\n"], components: [{ type:
|
|
1554
|
+
`, isInline: true, styles: ["*{font-family:Poppins,sans-serif}@media screen and (min-width: 320px){.header{background-color:#fff;display:flex;justify-content:space-between;filter:drop-shadow(0px -1px 7px #000)}mat-sidenav{width:-moz-fit-content!important;width:fit-content!important;background-color:#1c77f7!important}.img-logo,.text-container{display:none}.mat-toolbar.mat-primary{background-color:#fff!important;color:#003d99!important;filter:drop-shadow(0px -1px 7px #000)}.logout-container{box-shadow:#11111a1a 0 8px 24px,#11111a1a 0 16px 56px,#11111a1a 0 24px 80px;height:35px;width:auto;border-radius:30px;display:flex;margin-left:10px}.logout-button{display:flex;align-items:center;color:#1c77f7;font-weight:500;font-size:16px;margin-left:20px;text-align:center;width:150px}.photo-logout{background:url(http://qa.iptdev.com.co/assets/icons/exit.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat}.menu-icon{background:url(http://qa.iptdev.com.co/assets/icons/icon-menu.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat}.menu-icon-close{background:url(http://qa.iptdev.com.co/assets/icons/cruz.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat;width:35px;height:35px}.menu-container{box-shadow:#11111a1a 0 8px 24px,#11111a1a 0 16px 56px,#11111a1a 0 24px 80px;height:35px;width:52.5px;width:auto;border-radius:30px;display:flex}.menu-container:hover{cursor:pointer}.menu-container p{width:85px;display:flex;align-items:center;color:#1c77f7;font-weight:500;font-size:16px;margin:0 0 0 15px;text-align:center}}@media screen and (min-width: 768px){.img-logo{display:flex;width:120px;height:60px}.text-container{border-radius:40px;height:45px;width:100%;display:flex;gap:-100px;justify-content:center;flex-direction:column;align-items:flex-start}}.p1{color:gray;margin-left:30px;font-size:13px;height:20px}.p2{margin-left:30px;font-size:14px;font-weight:600;color:#1c77f7}.flex-container-menu{font-size:18px;color:#fff!important}.mat-nav-list{padding:0}\n"], components: [{ type: i4.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { type: i5.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { type: i6.MatNavList, selector: "mat-nav-list", inputs: ["disableRipple", "disabled"], exportAs: ["matNavList"] }, { type: AsideButtonComponent, selector: "ipt-aside-button", inputs: ["icon", "text", "buttonActive"], outputs: ["isClicked"] }], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1548
1555
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: SidenavComponent, decorators: [{
|
|
1549
1556
|
type: Component,
|
|
1550
1557
|
args: [{ selector: 'ipt-sidenav', template: `
|
|
@@ -1589,13 +1596,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImpor
|
|
|
1589
1596
|
</p>
|
|
1590
1597
|
</div>
|
|
1591
1598
|
|
|
1592
|
-
<div class="logout-container" (click)="logout()">
|
|
1599
|
+
<div *ngIf="!this.appUser" class="logout-container" (click)="logout()">
|
|
1593
1600
|
<p class="logout-button">Cerrar sesión</p>
|
|
1594
1601
|
<div class="photo-logout"></div>
|
|
1595
1602
|
</div>
|
|
1596
1603
|
</mat-toolbar>
|
|
1597
1604
|
`, styles: ["*{font-family:Poppins,sans-serif}@media screen and (min-width: 320px){.header{background-color:#fff;display:flex;justify-content:space-between;filter:drop-shadow(0px -1px 7px #000)}mat-sidenav{width:-moz-fit-content!important;width:fit-content!important;background-color:#1c77f7!important}.img-logo,.text-container{display:none}.mat-toolbar.mat-primary{background-color:#fff!important;color:#003d99!important;filter:drop-shadow(0px -1px 7px #000)}.logout-container{box-shadow:#11111a1a 0 8px 24px,#11111a1a 0 16px 56px,#11111a1a 0 24px 80px;height:35px;width:auto;border-radius:30px;display:flex;margin-left:10px}.logout-button{display:flex;align-items:center;color:#1c77f7;font-weight:500;font-size:16px;margin-left:20px;text-align:center;width:150px}.photo-logout{background:url(http://qa.iptdev.com.co/assets/icons/exit.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat}.menu-icon{background:url(http://qa.iptdev.com.co/assets/icons/icon-menu.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat}.menu-icon-close{background:url(http://qa.iptdev.com.co/assets/icons/cruz.png);background-size:25px 25px;background-position:center;background-repeat:no-repeat;width:35px;height:35px}.menu-container{box-shadow:#11111a1a 0 8px 24px,#11111a1a 0 16px 56px,#11111a1a 0 24px 80px;height:35px;width:52.5px;width:auto;border-radius:30px;display:flex}.menu-container:hover{cursor:pointer}.menu-container p{width:85px;display:flex;align-items:center;color:#1c77f7;font-weight:500;font-size:16px;margin:0 0 0 15px;text-align:center}}@media screen and (min-width: 768px){.img-logo{display:flex;width:120px;height:60px}.text-container{border-radius:40px;height:45px;width:100%;display:flex;gap:-100px;justify-content:center;flex-direction:column;align-items:flex-start}}.p1{color:gray;margin-left:30px;font-size:13px;height:20px}.p2{margin-left:30px;font-size:14px;font-weight:600;color:#1c77f7}.flex-container-menu{font-size:18px;color:#fff!important}.mat-nav-list{padding:0}\n"] }]
|
|
1598
|
-
}], ctorParameters: function () { return [{ type: UserService }, { type: StorageService }]; }, propDecorators: { department: [{
|
|
1605
|
+
}], ctorParameters: function () { return [{ type: UserService }, { type: i2.BaseService }, { type: StorageService }]; }, propDecorators: { department: [{
|
|
1599
1606
|
type: Input
|
|
1600
1607
|
}], setPage: [{
|
|
1601
1608
|
type: Input
|