@brggroup/share-lib 0.0.90 → 0.0.91

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.
@@ -543,212 +543,6 @@ class TokenStorage {
543
543
  }
544
544
  }
545
545
 
546
- class SessionManagerService {
547
- zone;
548
- constructor(zone) {
549
- this.zone = zone;
550
- }
551
- handlers;
552
- idleTimer;
553
- refreshTimer;
554
- heartbeatTimer;
555
- static IDLE_MIN = 15;
556
- REFRESH_BEFORE = 120;
557
- get IDLE_TIME() {
558
- return (SessionManagerService.IDLE_MIN || 0) * 60 * 1000;
559
- }
560
- LEADER_KEY = 'APP_SESSION_LEADER';
561
- HEARTBEAT_KEY = 'APP_SESSION_HEARTBEAT';
562
- ACTIVITY_KEY = 'APP_LAST_ACTIVITY';
563
- SESSION_EVENT = 'APP_SESSION_EVENT';
564
- LOGIN_EVENT = 'APP_LOGIN_EVENT';
565
- LOGOUT_EVENT = 'APP_LOGOUT_EVENT';
566
- ACTIVITY_EVENT = 'APP_ACTIVITY_EVENT';
567
- TOKEN_REFRESH_EVENT = 'APP_TOKEN_REFRESH_EVENT';
568
- tabId = crypto.randomUUID();
569
- isLeader = false;
570
- refreshLock = false;
571
- channel = null;
572
- /* -------------------------------- START -------------------------------- */
573
- start(handlers) {
574
- if (this.IDLE_TIME <= 0)
575
- return;
576
- this.handlers = handlers;
577
- if ('BroadcastChannel' in window) {
578
- this.channel = new BroadcastChannel('APP_SESSION');
579
- this.listenChannel();
580
- }
581
- this.listenActivity();
582
- this.updateActivity();
583
- this.resetIdle();
584
- this.electLeader();
585
- }
586
- stop() {
587
- clearTimeout(this.idleTimer);
588
- clearTimeout(this.refreshTimer);
589
- clearInterval(this.heartbeatTimer);
590
- }
591
- /* -------------------------------- ACTIVITY -------------------------------- */
592
- listenActivity() {
593
- const events = ['mousemove', 'keydown', 'click', 'scroll'];
594
- events.forEach((e) => {
595
- window.addEventListener(e, this.onActivity, true);
596
- });
597
- }
598
- onActivity = this.debounce(() => {
599
- this.updateActivity();
600
- this.resetIdle();
601
- this.broadcast(this.ACTIVITY_EVENT);
602
- }, 1000);
603
- updateActivity() {
604
- localStorage.setItem(this.ACTIVITY_KEY, Date.now().toString());
605
- }
606
- /* -------------------------------- IDLE -------------------------------- */
607
- resetIdle() {
608
- clearTimeout(this.idleTimer);
609
- const last = Number(localStorage.getItem(this.ACTIVITY_KEY) || Date.now());
610
- const remain = this.IDLE_TIME - (Date.now() - last);
611
- if (remain <= 0) {
612
- this.logout();
613
- return;
614
- }
615
- this.zone.runOutsideAngular(() => {
616
- this.idleTimer = setTimeout(() => {
617
- this.zone.run(() => this.logout());
618
- }, remain);
619
- });
620
- }
621
- /* -------------------------------- LEADER -------------------------------- */
622
- electLeader() {
623
- const leader = localStorage.getItem(this.LEADER_KEY);
624
- if (!leader) {
625
- this.becomeLeader();
626
- return;
627
- }
628
- this.checkLeaderHeartbeat();
629
- }
630
- becomeLeader() {
631
- this.isLeader = true;
632
- localStorage.setItem(this.LEADER_KEY, this.tabId);
633
- this.startHeartbeat();
634
- this.scheduleRefresh();
635
- }
636
- startHeartbeat() {
637
- this.heartbeatTimer = setInterval(() => {
638
- localStorage.setItem(this.HEARTBEAT_KEY, Date.now().toString());
639
- }, 2000);
640
- }
641
- checkLeaderHeartbeat() {
642
- setTimeout(() => {
643
- const beat = Number(localStorage.getItem(this.HEARTBEAT_KEY) || 0);
644
- if (Date.now() - beat > 5000) {
645
- this.becomeLeader();
646
- }
647
- }, 3000);
648
- }
649
- /* -------------------------------- REFRESH TOKEN -------------------------------- */
650
- scheduleRefresh() {
651
- if (!this.isLeader)
652
- return;
653
- clearTimeout(this.refreshTimer);
654
- const token = this.handlers.getToken();
655
- if (!token)
656
- return;
657
- const exp = this.parseJwt(token).exp * 1000;
658
- const delay = exp - Date.now() - this.REFRESH_BEFORE * 1000;
659
- if (delay <= 0) {
660
- this.refreshToken();
661
- return;
662
- }
663
- this.refreshTimer = setTimeout(() => {
664
- this.refreshToken();
665
- }, delay);
666
- }
667
- async refreshToken() {
668
- if (!this.isLeader || this.refreshLock)
669
- return;
670
- this.refreshLock = true;
671
- try {
672
- const res = await this.handlers.refreshToken();
673
- if (res?.IsSuccess) {
674
- this.broadcast(this.TOKEN_REFRESH_EVENT);
675
- this.scheduleRefresh();
676
- }
677
- else {
678
- this.logout();
679
- }
680
- }
681
- catch {
682
- this.logout();
683
- }
684
- finally {
685
- this.refreshLock = false;
686
- }
687
- }
688
- /* -------------------------------- CHANNEL -------------------------------- */
689
- listenChannel() {
690
- if (!this.channel)
691
- return;
692
- this.channel.onmessage = (msg) => {
693
- const type = msg.data?.type;
694
- if (type === this.ACTIVITY_EVENT) {
695
- this.resetIdle();
696
- }
697
- if (type === this.LOGOUT_EVENT) {
698
- console.log('APP_SESSION CHANNEL: ', this.LOGOUT_EVENT);
699
- this.handlers.logout();
700
- }
701
- if (type === this.LOGIN_EVENT) {
702
- console.log('APP_SESSION CHANNEL: ', this.LOGIN_EVENT);
703
- location.reload();
704
- }
705
- if (type === this.TOKEN_REFRESH_EVENT) {
706
- console.log('APP_SESSION CHANNEL: ', this.TOKEN_REFRESH_EVENT);
707
- this.scheduleRefresh();
708
- }
709
- };
710
- }
711
- broadcast(type) {
712
- if (this.channel) {
713
- this.channel.postMessage({ type });
714
- }
715
- else {
716
- localStorage.setItem(this.SESSION_EVENT, JSON.stringify({ type, t: Date.now() }));
717
- }
718
- }
719
- broadcastLogin() {
720
- this.broadcast(this.LOGIN_EVENT);
721
- }
722
- broadcastLogout() {
723
- this.broadcast(this.LOGOUT_EVENT);
724
- }
725
- /* -------------------------------- LOGOUT -------------------------------- */
726
- logout() {
727
- this.handlers.logout();
728
- this.broadcast(this.LOGOUT_EVENT);
729
- }
730
- /* -------------------------------- UTILS -------------------------------- */
731
- debounce(fn, delay) {
732
- let timer;
733
- return () => {
734
- clearTimeout(timer);
735
- timer = setTimeout(() => fn(), delay);
736
- };
737
- }
738
- parseJwt(token) {
739
- const payload = token.split('.')[1];
740
- return JSON.parse(atob(payload));
741
- }
742
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: SessionManagerService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
743
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: SessionManagerService, providedIn: 'root' });
744
- }
745
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: SessionManagerService, decorators: [{
746
- type: Injectable,
747
- args: [{
748
- providedIn: 'root',
749
- }]
750
- }], ctorParameters: () => [{ type: i0.NgZone }] });
751
-
752
546
  const URLs$4 = {
753
547
  login: '/api/Auth/Login',
754
548
  register: '/api/Auth/Register',
@@ -762,7 +556,6 @@ class AuthService extends HTTPService {
762
556
  commonService = inject(CommonService);
763
557
  router = inject(Router);
764
558
  translate = inject(TranslateService);
765
- sessionManager = inject(SessionManagerService);
766
559
  /* ----------------------------------------
767
560
  TOKEN
768
561
  ---------------------------------------- */
@@ -808,7 +601,6 @@ class AuthService extends HTTPService {
808
601
  }
809
602
  this.notiService.success('Đăng nhập thành công');
810
603
  TokenStorage.saveToken(res);
811
- this.sessionManager.broadcastLogin();
812
604
  if (returnUrl) {
813
605
  this.router.navigateByUrl(returnUrl);
814
606
  }
@@ -824,28 +616,11 @@ class AuthService extends HTTPService {
824
616
  headers: new HttpHeaders().set('Content-Type', 'application/json'),
825
617
  }));
826
618
  }
827
- /* ----------------------------------------
828
- INIT SESSION (reload page)
829
- ---------------------------------------- */
830
- initSession() {
831
- const token = TokenStorage.getToken();
832
- if (token) {
833
- this.sessionManager.start({
834
- refreshToken: () => this.refreshToken(),
835
- logout: () => this.signOut(),
836
- getToken: () => this.getToken(),
837
- });
838
- }
839
- }
840
619
  /* ----------------------------------------
841
620
  LOGOUT
842
621
  ---------------------------------------- */
843
- signOut(broadcastEvent = false) {
622
+ signOut() {
844
623
  TokenStorage.clearToken();
845
- if (broadcastEvent) {
846
- this.sessionManager.broadcastLogout();
847
- }
848
- this.sessionManager.stop();
849
624
  const currentUrl = this.router.routerState.snapshot.url;
850
625
  this.router.navigate(['/login'], {
851
626
  queryParams: { returnUrl: currentUrl || '/' },
@@ -1149,6 +924,209 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
1149
924
  }]
1150
925
  }] });
1151
926
 
927
+ class SessionManagerService {
928
+ zone;
929
+ constructor(zone) {
930
+ this.zone = zone;
931
+ }
932
+ authService = inject(AuthService);
933
+ idleTimer;
934
+ refreshTimer;
935
+ heartbeatTimer;
936
+ static IDLE_MIN = 15;
937
+ REFRESH_BEFORE = 120;
938
+ get IDLE_TIME() {
939
+ return (SessionManagerService.IDLE_MIN || 0) * 60 * 1000;
940
+ }
941
+ LEADER_KEY = 'APP_SESSION_LEADER';
942
+ HEARTBEAT_KEY = 'APP_SESSION_HEARTBEAT';
943
+ ACTIVITY_KEY = 'APP_LAST_ACTIVITY';
944
+ SESSION_EVENT = 'APP_SESSION_EVENT';
945
+ LOGIN_EVENT = 'APP_LOGIN_EVENT';
946
+ LOGOUT_EVENT = 'APP_LOGOUT_EVENT';
947
+ ACTIVITY_EVENT = 'APP_ACTIVITY_EVENT';
948
+ TOKEN_REFRESH_EVENT = 'APP_TOKEN_REFRESH_EVENT';
949
+ tabId = crypto.randomUUID();
950
+ isLeader = false;
951
+ refreshLock = false;
952
+ channel = null;
953
+ /* -------------------------------- START -------------------------------- */
954
+ start() {
955
+ if (this.IDLE_TIME <= 0)
956
+ return;
957
+ console.log('SessionManagerService > start > IDLE_TIME:', SessionManagerService.IDLE_MIN);
958
+ if ('BroadcastChannel' in window) {
959
+ this.channel = new BroadcastChannel('APP_SESSION');
960
+ this.listenChannel();
961
+ }
962
+ this.listenActivity();
963
+ this.updateActivity();
964
+ this.resetIdle();
965
+ this.electLeader();
966
+ }
967
+ stop() {
968
+ clearTimeout(this.idleTimer);
969
+ clearTimeout(this.refreshTimer);
970
+ clearInterval(this.heartbeatTimer);
971
+ }
972
+ async login(username, password, orgid, returnUrl) {
973
+ var ret = await this.authService.signIn(username, password, orgid, returnUrl);
974
+ if (ret) {
975
+ console.log('SessionManagerService > broadcast LOGIN');
976
+ this.broadcast(this.LOGIN_EVENT);
977
+ }
978
+ }
979
+ logout() {
980
+ this.authService.signOut();
981
+ this.broadcast(this.LOGOUT_EVENT);
982
+ }
983
+ /* -------------------------------- ACTIVITY -------------------------------- */
984
+ listenActivity() {
985
+ const events = ['mousemove', 'keydown', 'click', 'scroll'];
986
+ events.forEach((e) => {
987
+ window.addEventListener(e, this.onActivity, true);
988
+ });
989
+ }
990
+ onActivity = this.debounce(() => {
991
+ this.updateActivity();
992
+ this.resetIdle();
993
+ this.broadcast(this.ACTIVITY_EVENT);
994
+ }, 1000);
995
+ updateActivity() {
996
+ localStorage.setItem(this.ACTIVITY_KEY, Date.now().toString());
997
+ }
998
+ /* -------------------------------- IDLE -------------------------------- */
999
+ resetIdle() {
1000
+ clearTimeout(this.idleTimer);
1001
+ const last = Number(localStorage.getItem(this.ACTIVITY_KEY) || Date.now());
1002
+ const remain = this.IDLE_TIME - (Date.now() - last);
1003
+ if (remain <= 0) {
1004
+ this.authService.signOut();
1005
+ return;
1006
+ }
1007
+ this.zone.runOutsideAngular(() => {
1008
+ this.idleTimer = setTimeout(() => {
1009
+ this.zone.run(() => this.authService.signOut());
1010
+ }, remain);
1011
+ });
1012
+ }
1013
+ /* -------------------------------- LEADER -------------------------------- */
1014
+ electLeader() {
1015
+ const leader = localStorage.getItem(this.LEADER_KEY);
1016
+ if (!leader) {
1017
+ this.becomeLeader();
1018
+ return;
1019
+ }
1020
+ this.checkLeaderHeartbeat();
1021
+ }
1022
+ becomeLeader() {
1023
+ this.isLeader = true;
1024
+ localStorage.setItem(this.LEADER_KEY, this.tabId);
1025
+ this.startHeartbeat();
1026
+ this.scheduleRefresh();
1027
+ }
1028
+ startHeartbeat() {
1029
+ this.heartbeatTimer = setInterval(() => {
1030
+ localStorage.setItem(this.HEARTBEAT_KEY, Date.now().toString());
1031
+ }, 2000);
1032
+ }
1033
+ checkLeaderHeartbeat() {
1034
+ setTimeout(() => {
1035
+ const beat = Number(localStorage.getItem(this.HEARTBEAT_KEY) || 0);
1036
+ if (Date.now() - beat > 5000) {
1037
+ this.becomeLeader();
1038
+ }
1039
+ }, 3000);
1040
+ }
1041
+ /* -------------------------------- REFRESH TOKEN -------------------------------- */
1042
+ scheduleRefresh() {
1043
+ if (!this.isLeader)
1044
+ return;
1045
+ clearTimeout(this.refreshTimer);
1046
+ const token = this.authService.getToken();
1047
+ if (!token)
1048
+ return;
1049
+ const exp = this.parseJwt(token).exp * 1000;
1050
+ const delay = exp - Date.now() - this.REFRESH_BEFORE * 1000;
1051
+ if (delay <= 0) {
1052
+ this.refreshToken();
1053
+ return;
1054
+ }
1055
+ this.refreshTimer = setTimeout(() => {
1056
+ this.refreshToken();
1057
+ }, delay);
1058
+ }
1059
+ async refreshToken() {
1060
+ if (!this.isLeader || this.refreshLock)
1061
+ return;
1062
+ this.refreshLock = true;
1063
+ try {
1064
+ const res = await this.authService.refreshToken();
1065
+ if (res?.IsSuccess) {
1066
+ this.broadcast(this.TOKEN_REFRESH_EVENT);
1067
+ this.scheduleRefresh();
1068
+ }
1069
+ else {
1070
+ this.logout();
1071
+ }
1072
+ }
1073
+ catch {
1074
+ this.logout();
1075
+ }
1076
+ finally {
1077
+ this.refreshLock = false;
1078
+ }
1079
+ }
1080
+ /* -------------------------------- CHANNEL -------------------------------- */
1081
+ listenChannel() {
1082
+ if (!this.channel)
1083
+ return;
1084
+ this.channel.onmessage = (msg) => {
1085
+ const type = msg.data?.type;
1086
+ if (type === this.ACTIVITY_EVENT) {
1087
+ this.resetIdle();
1088
+ }
1089
+ if (type === this.LOGOUT_EVENT) {
1090
+ location.reload();
1091
+ }
1092
+ if (type === this.LOGIN_EVENT) {
1093
+ location.reload();
1094
+ }
1095
+ if (type === this.TOKEN_REFRESH_EVENT) {
1096
+ this.scheduleRefresh();
1097
+ }
1098
+ };
1099
+ }
1100
+ broadcast(type) {
1101
+ if (this.channel) {
1102
+ this.channel.postMessage({ type });
1103
+ }
1104
+ else {
1105
+ localStorage.setItem(this.SESSION_EVENT, JSON.stringify({ type, t: Date.now() }));
1106
+ }
1107
+ }
1108
+ /* -------------------------------- UTILS -------------------------------- */
1109
+ debounce(fn, delay) {
1110
+ let timer;
1111
+ return () => {
1112
+ clearTimeout(timer);
1113
+ timer = setTimeout(() => fn(), delay);
1114
+ };
1115
+ }
1116
+ parseJwt(token) {
1117
+ const payload = token.split('.')[1];
1118
+ return JSON.parse(atob(payload));
1119
+ }
1120
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: SessionManagerService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
1121
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: SessionManagerService, providedIn: 'root' });
1122
+ }
1123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: SessionManagerService, decorators: [{
1124
+ type: Injectable,
1125
+ args: [{
1126
+ providedIn: 'root',
1127
+ }]
1128
+ }], ctorParameters: () => [{ type: i0.NgZone }] });
1129
+
1152
1130
  class CustomModalService {
1153
1131
  modal;
1154
1132
  constructor(modal) {
@@ -6358,6 +6336,7 @@ const fadeSlide = trigger('fadeSlide', [
6358
6336
  class LayoutUser extends BaseComponent {
6359
6337
  cms = inject(CommonService);
6360
6338
  authService = inject(AuthService);
6339
+ sessionManager = inject(SessionManagerService);
6361
6340
  breakpointObserver = inject(BreakpointObserver);
6362
6341
  TokenStorage = TokenStorage;
6363
6342
  isXSmall = false;
@@ -6389,7 +6368,7 @@ class LayoutUser extends BaseComponent {
6389
6368
  this.goto('/admin/user_profile');
6390
6369
  }
6391
6370
  logout() {
6392
- this.authService.signOut(true);
6371
+ this.sessionManager.authService.signOut();
6393
6372
  }
6394
6373
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: LayoutUser, deps: null, target: i0.ɵɵFactoryTarget.Component });
6395
6374
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: LayoutUser, isStandalone: true, selector: "layout-user", usesInheritance: true, ngImport: i0, template: "<nz-badge [nzSize]=\"'small'\" [nzCount]=\"0\">\n <button nz-button nzType=\"text\" nzSize=\"small\">\n <nz-icon nzType=\"bell\" nzTheme=\"outline\" style=\"color: #ffffff\" />\n </button>\n</nz-badge>\n\n<button\n *ngIf=\"!isXSmall && TokenStorage.getOrgName()\"\n [@fadeInOut]\n nz-button\n nzType=\"text\"\n nz-dropdown\n [nzDropdownMenu]=\"menuOrg\"\n style=\"height: 50px; color: #ffffff\"\n>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" />\n {{ TokenStorage.getOrgName() }}\n</button>\n\n<nz-dropdown-menu #menuOrg=\"nzDropdownMenu\">\n <ul nz-menu>\n @for (org of lstOrg; track $index) {\n <li *ngIf=\"$index > 0\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"changeOrg(org)\">\n <nz-icon nzType=\"swap\" nzTheme=\"outline\" />&nbsp;&nbsp; {{ org.Name }}\n </li>\n }\n </ul>\n</nz-dropdown-menu>\n\n<button nz-button nzType=\"text\" nz-dropdown [nzDropdownMenu]=\"menuUser\" style=\"height: 50px; color: #ffffff\">\n <nz-icon nzType=\"user\" nzTheme=\"outline\" />\n {{ TokenStorage.getUserFullname() }}\n</button>\n\n<nz-dropdown-menu #menuUser=\"nzDropdownMenu\">\n <ul nz-menu>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-item>\n <nz-icon nzType=\"cluster\" nzTheme=\"outline\" />&nbsp;&nbsp; {{ TokenStorage.getOrgName() }}\n </li>\n <li *ngIf=\"!(!isXSmall && TokenStorage.getOrgName())\" nz-menu-divider></li>\n <li nz-menu-item (click)=\"gotoSetting()\">\n <nz-icon nzType=\"setting\" nzTheme=\"outline\" />&nbsp;&nbsp; {{ TranslateKey.SETTING | translate }}\n </li>\n <li nz-menu-divider></li>\n <li nz-menu-item (click)=\"logout()\">\n <nz-icon nzType=\"logout\" nzTheme=\"outline\" />&nbsp;&nbsp; {{ TranslateKey.LOGOUT | translate }}\n </li>\n </ul>\n</nz-dropdown-menu>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: NzLayoutModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1$2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i4$2.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i4$2.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i4$2.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i5$3.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5$3.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i5$3.NzDropdownButtonDirective, selector: "[nz-button][nz-dropdown]" }, { kind: "ngmodule", type: NzGridModule }, { kind: "ngmodule", type: NzFlexModule }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i8.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i9.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzTreeModule }, { kind: "ngmodule", type: NzBackTopModule }, { kind: "ngmodule", type: NzDrawerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: NzSegmentedModule }, { kind: "ngmodule", type: NzBadgeModule }, { kind: "component", type: i8$1.NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset", "nzSize"], exportAs: ["nzBadge"] }], animations: [fadeInOut] });