adata-ui 2.1.39 → 2.1.40-beta.1
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/.playground/app.vue +102 -0
- package/components/elements/button-login/index.vue +6 -10
- package/components/features/color-mode/AColorMode.client.vue +74 -32
- package/components/features/dropdown/ADropdownV2.vue +141 -0
- package/components/features/lang-switcher/lang-switcher.vue +120 -40
- package/components/features/pk-mobile-services/APkMobileServices.vue +5 -27
- package/components/features//321/201hange-version/AChangeVersion.vue +1 -1
- package/components/navigation/header/AHeader.vue +56 -33
- package/components/navigation/header/AlmatyContacts.vue +1 -1
- package/components/navigation/header/CardGallery.vue +5 -3
- package/components/navigation/header/ContactMenu.vue +26 -92
- package/components/navigation/header/HeaderLink.vue +189 -215
- package/components/navigation/header/HeaderUsage.vue +125 -0
- package/components/navigation/header/NavList.vue +56 -91
- package/components/navigation/header/ProductMenu.vue +79 -127
- package/components/navigation/header/ProfileMenu.vue +131 -150
- package/components/navigation/header/SystemNotification.vue +110 -0
- package/components/navigation/mobile-navigation/AMobileNavigation.vue +23 -15
- package/components/navigation/pill-tabs/APillTabs.vue +7 -2
- package/components/overlays/tooltip/ATooltipV2.vue +233 -0
- package/components/overlays/tooltip/types.ts +26 -0
- package/components/overlays/tooltip/useTooltipTrigger.ts +101 -0
- package/composables/useActiveNavigation.ts +84 -0
- package/composables/useHeaderNavigationLinks.ts +14 -7
- package/icons/gauge.vue +17 -0
- package/icons/sun.vue +13 -3
- package/lang/en.ts +6 -0
- package/lang/kk.ts +6 -0
- package/lang/ru.ts +6 -0
- package/package.json +1 -1
- package/components/navigation/header/TopHeader.vue +0 -196
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { ProjectKeys } from '#adata-ui/components/navigation/header/types'
|
|
3
3
|
import AColorMode from '#adata-ui/components/features/color-mode/AColorMode.client.vue'
|
|
4
|
+
import ADropdownV2 from '#adata-ui/components/features/dropdown/ADropdownV2.vue'
|
|
4
5
|
import LangSwitcher from '#adata-ui/components/features/lang-switcher/lang-switcher.vue'
|
|
5
6
|
import AChangeVersion from '#adata-ui/components/features/сhange-version/AChangeVersion.vue'
|
|
7
|
+
import HeaderUsage from '#adata-ui/components/navigation/header/HeaderUsage.vue'
|
|
6
8
|
import ProfileMenu from '#adata-ui/components/navigation/header/ProfileMenu.vue'
|
|
7
|
-
import
|
|
9
|
+
import SystemNotification from '#adata-ui/components/navigation/header/SystemNotification.vue'
|
|
8
10
|
import { useContacts, useCurrentModule } from '#adata-ui/composables/projectState'
|
|
11
|
+
import { useUrls } from '#adata-ui/composables/useUrls'
|
|
9
12
|
import AdataLogo from '#adata-ui/icons/adata-logo.vue'
|
|
10
|
-
import Arrow from '#adata-ui/icons/chevron/chevron-down.vue'
|
|
11
13
|
import Logo from '#adata-ui/icons/logo.vue'
|
|
12
14
|
import { buildLocalizedUrl, navigateToLocalizedPage } from '#adata-ui/utils/localizedNavigation'
|
|
15
|
+
import { useElementBounding } from '@vueuse/core'
|
|
13
16
|
import HeaderLink from './HeaderLink.vue'
|
|
14
|
-
import { useUrls } from '#adata-ui/composables/useUrls'
|
|
15
17
|
|
|
16
18
|
defineOptions({ name: 'AHeader' })
|
|
17
19
|
|
|
18
20
|
const props = withDefaults(defineProps<Props>(), {
|
|
19
21
|
limitRemaining: 0,
|
|
20
22
|
daysRemaining: 0,
|
|
23
|
+
maxLimit: 0,
|
|
21
24
|
balance: 0,
|
|
22
25
|
rate: 'Базовый',
|
|
23
26
|
showLogIn: true,
|
|
@@ -31,10 +34,11 @@ interface Props {
|
|
|
31
34
|
replenish?: string
|
|
32
35
|
hasNotification?: boolean
|
|
33
36
|
email: string | undefined
|
|
34
|
-
rate
|
|
35
|
-
daysRemaining
|
|
36
|
-
limitRemaining
|
|
37
|
-
|
|
37
|
+
rate?: string
|
|
38
|
+
daysRemaining?: number
|
|
39
|
+
limitRemaining?: number
|
|
40
|
+
maxLimit?: number
|
|
41
|
+
balance?: number
|
|
38
42
|
isAuthenticated: boolean
|
|
39
43
|
showLogIn?: boolean
|
|
40
44
|
mobileHeaderType?: 'search' | 'default'
|
|
@@ -42,18 +46,21 @@ interface Props {
|
|
|
42
46
|
oldVersion?: string
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
const { t } = useI18n()
|
|
46
49
|
const { locale } = useI18n()
|
|
47
50
|
|
|
48
51
|
useCurrentModule().value = props.module
|
|
49
|
-
const appConfig = useAppConfig()
|
|
50
52
|
const { myLayer }: any = useAppConfig()
|
|
51
53
|
const urls = useUrls()
|
|
52
54
|
|
|
53
|
-
const langIsOn =
|
|
54
|
-
const contacts =
|
|
55
|
+
const langIsOn = myLayer.langIsOn
|
|
56
|
+
const contacts = useContacts()
|
|
55
57
|
const { loginModal } = useIdModals()
|
|
56
58
|
|
|
59
|
+
// Anchor the navigation mega-menu to the actual bottom of the header bar so it
|
|
60
|
+
// stays aligned even when the system-notification banner is shown above it.
|
|
61
|
+
const headerRef = ref<HTMLElement | null>(null)
|
|
62
|
+
const { bottom: headerBottom } = useElementBounding(headerRef)
|
|
63
|
+
|
|
57
64
|
function goAuth() {
|
|
58
65
|
if (myLayer.authMode !== 'local') {
|
|
59
66
|
if (window) {
|
|
@@ -82,14 +89,13 @@ function goToAnotherModule() {
|
|
|
82
89
|
|
|
83
90
|
async function fetchContacts() {
|
|
84
91
|
try {
|
|
85
|
-
const
|
|
92
|
+
const { data } = await $fetch<{ data: unknown }>(
|
|
86
93
|
'https://pk-api.adata.kz/api/v1/data/counterparty/contacts/sales-department',
|
|
87
94
|
)
|
|
88
|
-
const { data } = await response.json()
|
|
89
95
|
contacts.value = data
|
|
90
96
|
}
|
|
91
97
|
catch (e) {
|
|
92
|
-
console.error(e.message)
|
|
98
|
+
console.error(e instanceof Error ? e.message : e)
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
|
|
@@ -100,14 +106,10 @@ onMounted(() => {
|
|
|
100
106
|
|
|
101
107
|
<template>
|
|
102
108
|
<div>
|
|
103
|
-
<
|
|
104
|
-
:days-remaining="daysRemaining"
|
|
105
|
-
:is-authenticated="isAuthenticated"
|
|
106
|
-
:module-name="module"
|
|
107
|
-
:limit-remaining="limitRemaining"
|
|
108
|
-
/>
|
|
109
|
+
<system-notification />
|
|
109
110
|
<header
|
|
110
|
-
|
|
111
|
+
ref="headerRef"
|
|
112
|
+
class="relative h-16 border-b border-deepblue-900/10 bg-gray-50/30 backdrop-blur-lg dark:border-gray-200/10 dark:bg-gray-900/30"
|
|
111
113
|
>
|
|
112
114
|
<div class="a-container mobile-padding flex h-full items-center justify-between gap-2">
|
|
113
115
|
<!-- Desktop hidden -->
|
|
@@ -156,7 +158,12 @@ onMounted(() => {
|
|
|
156
158
|
/>
|
|
157
159
|
</div>
|
|
158
160
|
<!-- Mobile hidden -->
|
|
159
|
-
<nav
|
|
161
|
+
<nav
|
|
162
|
+
class="hidden items-center gap-4 lg:flex"
|
|
163
|
+
itemscope
|
|
164
|
+
itemtype="https://schema.org/SiteNavigationElement"
|
|
165
|
+
role="list"
|
|
166
|
+
>
|
|
160
167
|
<nuxt-link-locale
|
|
161
168
|
aria-label="Adata-logo"
|
|
162
169
|
:to="buildLocalizedUrl(locale, urls.landing)"
|
|
@@ -169,11 +176,18 @@ onMounted(() => {
|
|
|
169
176
|
filled
|
|
170
177
|
/>
|
|
171
178
|
</nuxt-link-locale>
|
|
172
|
-
<header-link />
|
|
179
|
+
<header-link :menu-top="headerBottom || 64" />
|
|
173
180
|
</nav>
|
|
174
181
|
<div class="text-deepblue hidden items-center gap-4 dark:text-[#E3E5E8] lg:flex">
|
|
182
|
+
<header-usage
|
|
183
|
+
v-if="isAuthenticated"
|
|
184
|
+
:limit-remaining="limitRemaining"
|
|
185
|
+
:max-limit="maxLimit"
|
|
186
|
+
:days-remaining="daysRemaining"
|
|
187
|
+
/>
|
|
188
|
+
|
|
175
189
|
<!-- Mobile hidden -->
|
|
176
|
-
<div class="hidden items-center gap-
|
|
190
|
+
<div class="hidden items-center gap-2 lg:flex">
|
|
177
191
|
<a-change-version
|
|
178
192
|
v-if="oldVersion"
|
|
179
193
|
:url="oldVersion"
|
|
@@ -182,22 +196,31 @@ onMounted(() => {
|
|
|
182
196
|
<lang-switcher v-if="langIsOn || module === 'fea'" />
|
|
183
197
|
</div>
|
|
184
198
|
|
|
185
|
-
<a-dropdown
|
|
199
|
+
<a-dropdown-v2
|
|
186
200
|
v-show="isAuthenticated"
|
|
187
|
-
placement="
|
|
201
|
+
placement="bottom-end"
|
|
188
202
|
>
|
|
189
|
-
<template #default="{
|
|
190
|
-
<
|
|
191
|
-
|
|
203
|
+
<template #default="{ toggle, isOpen }">
|
|
204
|
+
<button
|
|
205
|
+
type="button"
|
|
206
|
+
class="hidden h-8 cursor-pointer items-center gap-1.5 rounded-full px-3 text-sm font-medium transition-colors duration-150 hover:bg-deepblue-900/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 focus-visible:ring-offset-1 dark:hover:bg-white/10 dark:focus-visible:ring-offset-gray-900 lg:inline-flex"
|
|
207
|
+
:class="isOpen
|
|
208
|
+
? 'bg-deepblue-900/10 text-deepblue-900 dark:bg-white/15 dark:text-white'
|
|
209
|
+
: 'text-gray-900 dark:text-gray-100'"
|
|
192
210
|
data-test-id="header-email-text"
|
|
193
|
-
|
|
211
|
+
:aria-label="email"
|
|
212
|
+
@click.stop="toggle"
|
|
194
213
|
>
|
|
195
214
|
<span>{{ email }}</span>
|
|
196
|
-
<
|
|
197
|
-
|
|
215
|
+
<a-icon-chevron-down
|
|
216
|
+
class="shrink-0 transition-transform duration-200"
|
|
217
|
+
:class="{ 'rotate-180': isOpen }"
|
|
218
|
+
/>
|
|
219
|
+
</button>
|
|
198
220
|
</template>
|
|
199
221
|
<template #content>
|
|
200
222
|
<profile-menu
|
|
223
|
+
:email="email"
|
|
201
224
|
:balance="balance"
|
|
202
225
|
:days-remaining="daysRemaining"
|
|
203
226
|
:limit-remaining="limitRemaining"
|
|
@@ -206,7 +229,7 @@ onMounted(() => {
|
|
|
206
229
|
@logout="$emit('logout')"
|
|
207
230
|
/>
|
|
208
231
|
</template>
|
|
209
|
-
</a-dropdown>
|
|
232
|
+
</a-dropdown-v2>
|
|
210
233
|
<a-button-login
|
|
211
234
|
v-show="!isAuthenticated && showLogIn"
|
|
212
235
|
@click="goAuth"
|
|
@@ -104,7 +104,7 @@ import ExpandWindow from "#adata-ui/icons/expand-window.vue";
|
|
|
104
104
|
import {useContacts} from "#adata-ui/composables/projectState";
|
|
105
105
|
|
|
106
106
|
const {t} = useI18n()
|
|
107
|
-
const contacts =
|
|
107
|
+
const contacts = useContacts()
|
|
108
108
|
const AlmatyItems = computed(() => ([
|
|
109
109
|
{
|
|
110
110
|
title: t('header.contacts.almaty.adress.title'),
|
|
@@ -150,12 +150,12 @@ onUnmounted(() => clearTimer())
|
|
|
150
150
|
</nuxt-link-locale>
|
|
151
151
|
</div>
|
|
152
152
|
</transition>
|
|
153
|
-
<div class="absolute
|
|
153
|
+
<div class="absolute bottom-4 w-full">
|
|
154
154
|
<div class="flex justify-center items-center gap-6">
|
|
155
155
|
<div
|
|
156
156
|
v-for="(item, index) in items"
|
|
157
157
|
:key="index"
|
|
158
|
-
class="relative bg-white/50 dark:bg-gray-900/50 rounded-full overflow-hidden cursor-pointer h-2 w-2"
|
|
158
|
+
class="relative bg-white/50 dark:bg-gray-900/50 rounded-full overflow-hidden cursor-pointer h-2 w-2 transition-[width] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]"
|
|
159
159
|
:class="{ 'w-[52px]': currentIndex === index }"
|
|
160
160
|
@click="setCurrentIndex(index)"
|
|
161
161
|
>
|
|
@@ -188,7 +188,9 @@ onUnmounted(() => clearTimer())
|
|
|
188
188
|
top: 0;
|
|
189
189
|
left: 0;
|
|
190
190
|
width: 100%;
|
|
191
|
-
transition:
|
|
191
|
+
transition:
|
|
192
|
+
transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
|
|
193
|
+
opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
.slide-left-enter-from {
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import AlmatyContacts from
|
|
3
|
-
import AstanaContacts from
|
|
2
|
+
import AlmatyContacts from '#adata-ui/components/navigation/header/AlmatyContacts.vue'
|
|
3
|
+
import AstanaContacts from '#adata-ui/components/navigation/header/AstanaContacts.vue'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
defineProps<{
|
|
7
|
-
animation?: string
|
|
8
|
-
index?: number
|
|
9
|
-
url?: string
|
|
10
|
-
}>(),
|
|
11
|
-
{
|
|
12
|
-
animation: 'previous',
|
|
13
|
-
index: 2,
|
|
14
|
-
url:''
|
|
15
|
-
}
|
|
16
|
-
)
|
|
5
|
+
defineProps<{ url?: string }>()
|
|
17
6
|
defineEmits(['outerClick', 'mouseOver'])
|
|
18
7
|
|
|
19
8
|
const { t } = useI18n()
|
|
@@ -21,94 +10,39 @@ const activeTab = ref(0)
|
|
|
21
10
|
const options = [
|
|
22
11
|
{
|
|
23
12
|
key: 0,
|
|
24
|
-
name: 'ТОО "Alldata"'
|
|
13
|
+
name: 'ТОО "Alldata"',
|
|
25
14
|
},
|
|
26
15
|
{
|
|
27
16
|
key: 1,
|
|
28
|
-
name: ' ТОО «ADATA Consulting»'
|
|
17
|
+
name: ' ТОО «ADATA Consulting»',
|
|
29
18
|
},
|
|
30
19
|
]
|
|
31
|
-
|
|
32
20
|
</script>
|
|
33
21
|
|
|
34
22
|
<template>
|
|
35
|
-
<div class="
|
|
23
|
+
<div class="normal-case">
|
|
36
24
|
<div class="bg-white dark:bg-gray-950">
|
|
37
|
-
<
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</div>
|
|
57
|
-
<div>
|
|
58
|
-
<almaty-contacts v-show="activeTab===0" />
|
|
59
|
-
<astana-contacts v-show="activeTab===1" />
|
|
60
|
-
</div>
|
|
25
|
+
<div class="a-container">
|
|
26
|
+
<div class="mb-8 flex justify-between pt-2">
|
|
27
|
+
<a-pill-tabs
|
|
28
|
+
v-model="activeTab"
|
|
29
|
+
class="gap-2"
|
|
30
|
+
view="mobile"
|
|
31
|
+
:options="options"
|
|
32
|
+
size="lg"
|
|
33
|
+
/>
|
|
34
|
+
<nuxt-link :to="url">
|
|
35
|
+
<a-button variant="gray">
|
|
36
|
+
{{ t('header.contacts.toContacts') }}
|
|
37
|
+
<a-icon-arrow-top-right-on-square />
|
|
38
|
+
</a-button>
|
|
39
|
+
</nuxt-link>
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
<almaty-contacts v-show="activeTab === 0" />
|
|
43
|
+
<astana-contacts v-show="activeTab === 1" />
|
|
61
44
|
</div>
|
|
62
|
-
</
|
|
63
|
-
<button
|
|
64
|
-
class="absolute right-8 top-4"
|
|
65
|
-
@click="$emit('outerClick')"
|
|
66
|
-
>
|
|
67
|
-
<a-icon-x-mark
|
|
68
|
-
width="32"
|
|
69
|
-
height="32"
|
|
70
|
-
/>
|
|
71
|
-
</button>
|
|
45
|
+
</div>
|
|
72
46
|
</div>
|
|
73
47
|
</div>
|
|
74
48
|
</template>
|
|
75
|
-
|
|
76
|
-
<style scoped lang="scss">
|
|
77
|
-
$percent: 30%;
|
|
78
|
-
.next-enter-from,
|
|
79
|
-
.next-leave-to {
|
|
80
|
-
opacity: 0;
|
|
81
|
-
transform: translateX($percent);
|
|
82
|
-
position: absolute;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.next-enter-active {
|
|
86
|
-
transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.next-leave-active {
|
|
90
|
-
transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
91
|
-
opacity: 0;
|
|
92
|
-
transform: translateX(-$percent);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Backwards transition
|
|
96
|
-
|
|
97
|
-
.prev-enter-from,
|
|
98
|
-
.prev-leave-to {
|
|
99
|
-
position: absolute;
|
|
100
|
-
|
|
101
|
-
opacity: 0;
|
|
102
|
-
transform: translateX(-$percent);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.prev-enter-active {
|
|
106
|
-
transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.prev-leave-active {
|
|
110
|
-
transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
111
|
-
opacity: 0;
|
|
112
|
-
transform: translateX($percent);
|
|
113
|
-
}
|
|
114
|
-
</style>
|