Files
doneit-web/.angular/cache/14.2.12/babel-webpack/aa6f11d3c0967ab775628af3be668ef4.json
T
Eudes Inácio 53b71ea16f its working
2023-06-30 09:54:21 +01:00

1 line
22 KiB
JSON

{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./header.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./header.page.scss?ngResource\";\nimport { Component } from '@angular/core';\nimport { AnimationController, ModalController, Platform } from '@ionic/angular';\nimport { SearchPage } from 'src/app/pages/search/search.page';\nimport { Router } from '@angular/router';\nimport { StorageService } from '../../services/storage.service';\nimport { SessionStore } from 'src/app/store/session.service';\nimport { environment } from 'src/environments/environment';\nimport { ThemeService } from '../../services/theme.service';\nimport { RouteService } from 'src/app/services/route.service';\nimport { PermissionList } from 'src/app/models/permission/permissionList';\nimport { PermissionService } from 'src/app/services/permission.service';\nimport { EventTrigger } from 'src/app/services/eventTrigger.service';\nimport { ActiveTabService } from 'src/app/services/active-tab.service';\nimport { NotificationsService } from 'src/app/services/notifications.service';\nimport { TinymcePage } from 'src/app/tinymce/tinymce.page';\nlet HeaderPage = class HeaderPage {\n constructor(router, modalController, animationController, storageservice, platform, ThemeService, RouteService, p, eventTriger, ActiveTabService, notificationService) {\n this.router = router;\n this.modalController = modalController;\n this.animationController = animationController;\n this.storageservice = storageservice;\n this.platform = platform;\n this.ThemeService = ThemeService;\n this.RouteService = RouteService;\n this.p = p;\n this.eventTriger = eventTriger;\n this.ActiveTabService = ActiveTabService;\n this.notificationService = notificationService;\n this.searchSubject = '';\n this.showSearch = false;\n this.hideSearchBtn = false;\n this.notificationdata = [];\n this.DataArray = [];\n this.notificationLength = 0;\n this.SessionStore = SessionStore;\n this.production = environment.production;\n this.environment = environment;\n this.canOpenSearch = false;\n this.showProfileModal = false;\n this.permissionList = new PermissionList();\n this.notificationCount = 0;\n this.loggeduser = SessionStore.user;\n router.events.subscribe(val => {\n this.hideSearch();\n this.showSearch = false;\n this.canOpenSearch = true;\n this.showProfileModal = false;\n });\n this.eventTriger.getObservable().subscribe(event => {\n if (event.notification == \"recive\") {\n console.log('header', event.notification);\n this.notificationLength++;\n } else if (event.notification == \"deleted\") {\n console.log('header', event.notification);\n this.notificationLength--;\n }\n });\n /* this.notificationService.notificationReceived.subscribe(() => {\r\n console.log('header', 'event.notification')\r\n this.notificationLengthData()\r\n }); */\n }\n\n ngOnInit() {\n var _this = this;\n return _asyncToGenerator(function* () {\n _this.hideSearch();\n _this.notificationLengthData();\n })();\n }\n notificationLengthData() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n yield _this2.storageservice.get(\"Notifications\").then(value => {\n /* var data = JSON.parse(value); */\n _this2.notificationLength = value.length;\n }).catch(error => {\n if (!error) {\n _this2.notificationLength = 0;\n } else {\n console.error('header storage get notification', error);\n }\n });\n })();\n }\n hideSearch() {\n if (this.router.url.startsWith('/home/events') || this.router.url.startsWith('/home/chat')) {\n this.hideSearchBtn = true;\n } else {\n this.hideSearchBtn = false;\n }\n }\n openSearch() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n let classs, showSearchInput, type;\n if (window.innerWidth < 1366) {\n classs = 'modal modal-width-100';\n showSearchInput = true;\n } else {\n classs = 'modal modal-desktop desktop-search';\n showSearchInput = false;\n }\n if (window.location.pathname.startsWith('/home/agenda')) {\n type = \"Agenda\";\n } else if (window.location.pathname.startsWith('/home/gabinete-digital')) {\n type = \"AccoesPresidenciais & ArquivoDespachoElect\";\n } else if (window.location.pathname.startsWith('/home/publications')) {\n type = \"AccoesPresidenciais\";\n }\n if (_this3.canOpenSearch) {\n _this3.canOpenSearch = false;\n const modal = yield _this3.modalController.create({\n component: SearchPage,\n cssClass: classs,\n componentProps: {\n type: type,\n showSearchInput: showSearchInput,\n select: false\n }\n });\n yield modal.present();\n modal.onDidDismiss().then(() => {\n _this3.canOpenSearch = true;\n });\n }\n })();\n }\n changeRoute(path) {\n this.router.navigateByUrl(path);\n }\n openProfile() {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n const enterAnimation = baseEl => {\n const backdropAnimation = _this4.animationController.create().addElement(baseEl.querySelector('ion-backdrop')).fromTo('opacity', '0.01', 'var(--backdrop-opacity)');\n const wrapperAnimation = _this4.animationController.create().addElement(baseEl.querySelector('.modal-wrapper')).keyframes([{\n offset: 0,\n opacity: '1',\n right: '-100%'\n }, {\n offset: 1,\n opacity: '1',\n right: '0px'\n }]);\n return _this4.animationController.create().addElement(baseEl).easing('ease-out').duration(500).addAnimation([backdropAnimation, wrapperAnimation]);\n };\n const leaveAnimation = baseEl => {\n return enterAnimation(baseEl).direction('reverse');\n };\n if (!_this4.showProfileModal) {\n _this4.showProfileModal = true;\n const modal = yield _this4.modalController.create({\n component: TinymcePage,\n cssClass: 'model profile-modal search-submodal',\n componentProps: {}\n });\n yield modal.present();\n modal.onDidDismiss().then(() => {\n _this4.notificationLengthData();\n _this4.showProfileModal = false;\n });\n }\n })();\n }\n dynamicSearch() {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n if (window['dynamicSearch']) {\n window['dynamicSearch'](_this5.searchSubject);\n } else {\n setTimeout(() => {\n _this5.dynamicSearch();\n }, 100);\n }\n })();\n }\n closeSearch() {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n _this6.modalController.dismiss();\n })();\n }\n /**\r\n * @description set empty value to searchSubject\r\n */\n clearSearchInput() {\n this.searchSubject = \"\";\n window['dynamicSearch'](this.searchSubject);\n }\n basicSearch() {\n var _this7 = this;\n return _asyncToGenerator(function* () {\n if (window['searchTriger']) {\n window['searchTriger']();\n } else {\n setTimeout(() => {\n _this7.basicSearch();\n }, 100);\n }\n })();\n }\n};\nHeaderPage.ctorParameters = () => [{\n type: Router\n}, {\n type: ModalController\n}, {\n type: AnimationController\n}, {\n type: StorageService\n}, {\n type: Platform\n}, {\n type: ThemeService\n}, {\n type: RouteService\n}, {\n type: PermissionService\n}, {\n type: EventTrigger\n}, {\n type: ActiveTabService\n}, {\n type: NotificationsService\n}];\nHeaderPage = __decorate([Component({\n selector: 'app-header',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], HeaderPage);\nexport { HeaderPage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,QAAgB,eAAe;AACjD,SAASC,mBAAmB,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,gBAAgB;AAC/E,SAASC,UAAU,QAAQ,kCAAkC;AAC7D,SAASC,MAAM,QAAQ,iBAAiB;AAGxC,SAASC,cAAc,QAAQ,gCAAgC;AAC/D,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,cAAc,QAAQ,0CAA0C;AACzE,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,YAAY,QAAQ,uCAAuC;AACpE,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,oBAAoB,QAAQ,wCAAwC;AAC7E,SAASC,WAAW,QAAQ,8BAA8B;AAOnD,IAAMC,UAAU,GAAhB,MAAMA,UAAU;EAoBrBC,YACUC,MAAc,EACdC,eAAgC,EAChCC,mBAAwC,EACxCC,cAA8B,EAC/BC,QAAkB,EAClBd,YAA0B,EAC1BC,YAA0B,EAC1Bc,CAAoB,EACnBC,WAAyB,EAC1BX,gBAAkC,EACjCY,mBAAyC;IAVzC,WAAM,GAANP,MAAM;IACN,oBAAe,GAAfC,eAAe;IACf,wBAAmB,GAAnBC,mBAAmB;IACnB,mBAAc,GAAdC,cAAc;IACf,aAAQ,GAARC,QAAQ;IACR,iBAAY,GAAZd,YAAY;IACZ,iBAAY,GAAZC,YAAY;IACZ,MAAC,GAADc,CAAC;IACA,gBAAW,GAAXC,WAAW;IACZ,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AA;IAAA;MAEf,IAAG1C,MAAM,CAAC,cAAc,CAAC,EAAE;QACzBA,MAAM,CAAC,cAAc,CAAC,EAAE;OACzB,MAAM;QACLqC,UAAU,CAAC,MAAI;UACbM,MAAI,CAACD,WAAW,EAAE;QACpB,CAAC,EAAE,GAAG,CAAC;;IACR;EAEH;;;;;;;;;;;;;;;;;;;;;;;;;AAzNWrF,UAAU,eALtBjB,SAAS,CAAC;EACTwG,QAAQ,EAAE,YAAY;EACtBC,8BAAiC;;CAElC,CAAC,GACWxF,UAAU;SAAVA,UAAU","names":["Component","AnimationController","ModalController","Platform","SearchPage","Router","StorageService","SessionStore","environment","ThemeService","RouteService","PermissionList","PermissionService","EventTrigger","ActiveTabService","NotificationsService","TinymcePage","HeaderPage","constructor","router","modalController","animationController","storageservice","platform","p","eventTriger","notificationService","production","loggeduser","user","events","subscribe","val","hideSearch","showSearch","canOpenSearch","showProfileModal","getObservable","event","notification","console","log","notificationLength","ngOnInit","_this","notificationLengthData","_this2","get","then","value","length","catch","error","url","startsWith","hideSearchBtn","openSearch","classs","showSearchInput","type","window","innerWidth","location","pathname","_this3","modal","create","component","cssClass","componentProps","select","present","onDidDismiss","changeRoute","path","navigateByUrl","openProfile","enterAnimation","baseEl","backdropAnimation","_this4","addElement","querySelector","fromTo","wrapperAnimation","keyframes","offset","opacity","right","easing","duration","addAnimation","leaveAnimation","direction","dynamicSearch","_this5","searchSubject","setTimeout","closeSearch","_this6","dismiss","clearSearchInput","basicSearch","_this7","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\shared\\header\\header.page.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\r\nimport { AnimationController, ModalController, Platform } from '@ionic/angular';\r\nimport { SearchPage } from 'src/app/pages/search/search.page';\r\nimport { Router } from '@angular/router';\r\nimport { LoginUserRespose } from 'src/app/models/user.model';\r\nimport { ProfilePage } from 'src/app/modals/profile/profile.page';\r\nimport { StorageService } from '../../services/storage.service';\r\nimport { SessionStore } from 'src/app/store/session.service';\r\nimport { environment } from 'src/environments/environment';\r\nimport { ThemeService } from '../../services/theme.service';\r\nimport { RouteService } from 'src/app/services/route.service';\r\nimport { PermissionList } from 'src/app/models/permission/permissionList';\r\nimport { PermissionService } from 'src/app/services/permission.service';\r\nimport { EventTrigger } from 'src/app/services/eventTrigger.service'\r\nimport { ActiveTabService } from 'src/app/services/active-tab.service';\r\nimport { NotificationsService } from 'src/app/services/notifications.service';\r\nimport { TinymcePage } from 'src/app/tinymce/tinymce.page';\r\n\r\n@Component({\r\n selector: 'app-header',\r\n templateUrl: './header.page.html',\r\n styleUrls: ['./header.page.scss'],\r\n})\r\nexport class HeaderPage implements OnInit {\r\n\r\n searchSubject: string = '';\r\n showSearch = false;\r\n loggeduser: LoginUserRespose;\r\n hideSearchBtn: boolean = false;\r\n notificationdata: any[] = [];\r\n DataArray: Array<object> = [];\r\n notificationLength: number = 0;\r\n SessionStore = SessionStore\r\n check: boolean;\r\n\r\n production = environment.production\r\n environment = environment\r\n canOpenSearch = false\r\n showProfileModal = false\r\n permissionList = new PermissionList();\r\n notificationCount: number = 0;\r\n \r\n\r\n constructor(\r\n private router: Router,\r\n private modalController: ModalController,\r\n private animationController: AnimationController,\r\n private storageservice: StorageService,\r\n public platform: Platform,\r\n public ThemeService: ThemeService,\r\n public RouteService: RouteService,\r\n public p: PermissionService,\r\n private eventTriger: EventTrigger,\r\n public ActiveTabService: ActiveTabService,\r\n private notificationService: NotificationsService\r\n ) {\r\n this.loggeduser = SessionStore.user;\r\n router.events.subscribe((val) => {\r\n this.hideSearch();\r\n this.showSearch = false;\r\n this.canOpenSearch = true;\r\n this.showProfileModal = false\r\n });\r\n\r\n this.eventTriger.getObservable().subscribe((event) => {\r\n if(event.notification == \"recive\") {\r\n console.log('header', event.notification)\r\n this.notificationLength++\r\n } else if(event.notification == \"deleted\") {\r\n console.log('header', event.notification)\r\n this.notificationLength--\r\n }\r\n });\r\n\r\n /* this.notificationService.notificationReceived.subscribe(() => {\r\n console.log('header', 'event.notification')\r\n this.notificationLengthData()\r\n }); */\r\n\r\n \r\n }\r\n\r\n async ngOnInit() {\r\n this.hideSearch();\r\n this.notificationLengthData();\r\n \r\n }\r\n\r\n\r\n async notificationLengthData() {\r\n await this.storageservice.get(\"Notifications\").then((value) => {\r\n \r\n\r\n /* var data = JSON.parse(value); */\r\n this.notificationLength = value.length;\r\n \r\n }).catch((error) => {\r\n if(!error) {\r\n this.notificationLength = 0;\r\n } else {\r\n console.error('header storage get notification', error)\r\n }\r\n })\r\n }\r\n\r\n hideSearch() {\r\n if (this.router.url.startsWith('/home/events') || this.router.url.startsWith('/home/chat')) {\r\n this.hideSearchBtn = true;\r\n } else {\r\n this.hideSearchBtn = false;\r\n }\r\n }\r\n\r\n\r\n async openSearch() {\r\n\r\n let classs, showSearchInput, type;\r\n if (window.innerWidth < 1366) {\r\n classs = 'modal modal-width-100'\r\n showSearchInput = true\r\n } else {\r\n classs = 'modal modal-desktop desktop-search'\r\n showSearchInput = false\r\n }\r\n\r\n if (window.location.pathname.startsWith('/home/agenda')) {\r\n type = \"Agenda\"\r\n } else if (window.location.pathname.startsWith('/home/gabinete-digital')) {\r\n type = \"AccoesPresidenciais & ArquivoDespachoElect\"\r\n\r\n } else if (window.location.pathname.startsWith('/home/publications')) {\r\n type = \"AccoesPresidenciais\"\r\n }\r\n\r\n if(this.canOpenSearch) {\r\n this.canOpenSearch = false\r\n \r\n const modal = await this.modalController.create({\r\n component: SearchPage,\r\n cssClass: classs,\r\n componentProps: {\r\n type: type,\r\n showSearchInput: showSearchInput,\r\n select: false\r\n }\r\n });\r\n\r\n await modal.present();\r\n\r\n modal.onDidDismiss().then(() => {\r\n\r\n this.canOpenSearch = true;\r\n\r\n });\r\n\r\n }\r\n }\r\n\r\n changeRoute(path) {\r\n this.router.navigateByUrl(path)\r\n }\r\n\r\n\r\n async openProfile() {\r\n\r\n const enterAnimation = (baseEl: any) => {\r\n const backdropAnimation = this.animationController.create()\r\n .addElement(baseEl.querySelector('ion-backdrop')!)\r\n .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');\r\n\r\n const wrapperAnimation = this.animationController.create()\r\n .addElement(baseEl.querySelector('.modal-wrapper')!)\r\n .keyframes([\r\n { offset: 0, opacity: '1', right: '-100%' },\r\n { offset: 1, opacity: '1', right: '0px' }\r\n ]);\r\n\r\n return this.animationController.create()\r\n .addElement(baseEl)\r\n .easing('ease-out')\r\n .duration(500)\r\n .addAnimation([backdropAnimation, wrapperAnimation]);\r\n }\r\n\r\n const leaveAnimation = (baseEl: any) => {\r\n return enterAnimation(baseEl).direction('reverse');\r\n }\r\n\r\n if(!this.showProfileModal) {\r\n this.showProfileModal = true\r\n const modal = await this.modalController.create({\r\n component: TinymcePage,\r\n cssClass: 'model profile-modal search-submodal',\r\n componentProps: {\r\n }\r\n });\r\n await modal.present();\r\n \r\n modal.onDidDismiss().then(() => {\r\n this.notificationLengthData()\r\n this.showProfileModal = false\r\n })\r\n }\r\n \r\n }\r\n\r\n async dynamicSearch() {\r\n\r\n if(window['dynamicSearch']) {\r\n window['dynamicSearch'](this.searchSubject)\r\n } else {\r\n setTimeout(()=>{\r\n this.dynamicSearch()\r\n }, 100)\r\n }\r\n }\r\n\r\n\r\n async closeSearch() {\r\n this.modalController.dismiss()\r\n }\r\n\r\n /**\r\n * @description set empty value to searchSubject\r\n */\r\n clearSearchInput() {\r\n this.searchSubject = \"\";\r\n window['dynamicSearch'](this.searchSubject)\r\n }\r\n\r\n async basicSearch() {\r\n \r\n if(window['searchTriger']) {\r\n window['searchTriger']()\r\n } else {\r\n setTimeout(()=>{\r\n this.basicSearch()\r\n }, 100)\r\n }\r\n\r\n }\r\n\r\n}\r\n"]},"metadata":{},"sourceType":"module"}