@@ -14,6 +14,7 @@ import { computed, ref } from 'vue';
14
14
import LoadingBarProvider from ' ~/components/container/LoadingBarProvider.vue' ;
15
15
import MessageProvider from ' ~/components/container/MessageProvider.vue' ;
16
16
import NotificationProvider from ' ~/components/container/NotificationProvider.vue' ;
17
+ import { NavbarService } from ' ~/services/navbar.service' ;
17
18
import { lazyComponent } from ' ~/utils/lazy.utils' ;
18
19
19
20
const AppComponent = lazyComponent (() => import (' ~/components/AppComponent.vue' ));
@@ -25,6 +26,9 @@ const override: GlobalThemeOverrides = {
25
26
// TODO red palette
26
27
};
27
28
29
+ const { drawer } = NavbarService ;
30
+ const drawerOpen = NavbarService .open ;
31
+
28
32
const root = ref <HTMLElement >();
29
33
</script >
30
34
@@ -35,16 +39,40 @@ const root = ref<HTMLElement>();
35
39
36
40
<NLoadingBarProvider
37
41
:to =" root"
38
- :loading-bar-style =" { loading: { '--n-color-loading': 'white' } }"
42
+ :loading-bar-style =" { loading: { '--n-color-loading': 'var(--vt-c- white) ' } }"
39
43
>
40
44
<LoadingBarProvider />
41
45
</NLoadingBarProvider >
42
46
43
- <NMessageProvider :to =" root" >
47
+ <NMessageProvider
48
+ :to =" root"
49
+ :max =" 2"
50
+ :container-class ="
51
+ [
52
+ 'message-container',
53
+ drawer ? 'has-drawer' : '',
54
+ drawerOpen ? 'drawer-visible' : '',
55
+ ]
56
+ .filter(Boolean)
57
+ .join(' ')
58
+ "
59
+ >
44
60
<MessageProvider />
45
61
</NMessageProvider >
46
62
47
- <NNotificationProvider :to =" root" >
63
+ <NNotificationProvider
64
+ :to =" root"
65
+ :max =" 2"
66
+ :container-class ="
67
+ [
68
+ 'notification-container',
69
+ drawer ? 'has-drawer' : '',
70
+ drawerOpen ? 'drawer-visible' : '',
71
+ ]
72
+ .filter(Boolean)
73
+ .join(' ')
74
+ "
75
+ >
48
76
<NotificationProvider />
49
77
</NNotificationProvider >
50
78
</NConfigProvider >
@@ -54,6 +82,7 @@ const root = ref<HTMLElement>();
54
82
<style lang="scss">
55
83
@use ' ~/styles/base.scss' ;
56
84
@use ' ~/styles/mixin' as mixin ;
85
+ @use ' ~/styles/layout' as layout ;
57
86
58
87
:host {
59
88
display : flex ;
@@ -88,6 +117,26 @@ const root = ref<HTMLElement>();
88
117
height : 100% ;
89
118
}
90
119
120
+ .notification-container.n-notification-container.n-notification-container {
121
+ @include layout .navbar-transition ($transition : top );
122
+
123
+ top : layout .$header-navbar-height ;
124
+
125
+ & .drawer-visible {
126
+ top : layout .$header-open-drawer-height ;
127
+ }
128
+ }
129
+
130
+ .message-container.n-message-container.n-message-container {
131
+ @include layout .navbar-transition ($transition : top );
132
+
133
+ top : calc (#{layout .$header-navbar-height } + 12px );
134
+
135
+ & .drawer-visible {
136
+ top : calc (#{layout .$header-open-drawer-height } + 12px );
137
+ }
138
+ }
139
+
91
140
.n-dropdown-menu ,
92
141
.n-date-panel ,
93
142
.n-virtual-list {
@@ -119,6 +168,8 @@ const root = ref<HTMLElement>();
119
168
backdrop-filter : blur (var (--bg-blur ));
120
169
}
121
170
171
+ .n-message-wrapper .n-message ,
172
+ .n-notification-container .n-notification ,
122
173
.n-tooltip.n-tooltip ,
123
174
.n-popover-arrow.n-popover-arrow.n-popover-arrow {
124
175
background : var (--bg-color-60 );
0 commit comments