adata-ui 2.0.47 → 2.0.48

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/.nuxtrc CHANGED
@@ -1 +1 @@
1
- typescript.includeWorkspace = true
1
+ typescript.includeWorkspace = true
@@ -1,5 +1,5 @@
1
- export default defineAppConfig({
2
- myLayer: {
3
- name: 'My amazing Nuxt layer (overwritten)'
4
- }
5
- })
1
+ export default defineAppConfig({
2
+ myLayer: {
3
+ name: 'My amazing Nuxt layer (overwritten)'
4
+ }
5
+ })
package/README.md CHANGED
@@ -1,75 +1,75 @@
1
- # Adata UI with Nuxt 3 using Layers
2
-
3
- Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4
-
5
- ## Setup
6
-
7
- Make sure to install the dependencies:
8
-
9
- ```bash
10
- # npm
11
- npm install
12
-
13
- # pnpm
14
- pnpm install
15
-
16
- # yarn
17
- yarn install
18
-
19
- # bun
20
- bun install
21
- ```
22
-
23
- ## Development Server
24
-
25
- Start the development server on `https://localhost:3000`:
26
-
27
- ```bash
28
- # npm
29
- npm run dev
30
-
31
- # pnpm
32
- pnpm run dev
33
-
34
- # yarn
35
- yarn dev
36
-
37
- # bun
38
- bun run dev
39
- ```
40
-
41
- ## Production
42
-
43
- Build the application for production:
44
-
45
- ```bash
46
- # npm
47
- npm run build
48
-
49
- # pnpm
50
- pnpm run build
51
-
52
- # yarn
53
- yarn build
54
-
55
- # bun
56
- bun run build
57
- ```
58
-
59
- Locally preview production build:
60
-
61
- ```bash
62
- # npm
63
- npm run preview
64
-
65
- # pnpm
66
- pnpm run preview
67
-
68
- # yarn
69
- yarn preview
70
-
71
- # bun
72
- bun run preview
73
- ```
74
-
75
- Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
1
+ # Adata UI with Nuxt 3 using Layers
2
+
3
+ Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4
+
5
+ ## Setup
6
+
7
+ Make sure to install the dependencies:
8
+
9
+ ```bash
10
+ # npm
11
+ npm install
12
+
13
+ # pnpm
14
+ pnpm install
15
+
16
+ # yarn
17
+ yarn install
18
+
19
+ # bun
20
+ bun install
21
+ ```
22
+
23
+ ## Development Server
24
+
25
+ Start the development server on `https://localhost:3000`:
26
+
27
+ ```bash
28
+ # npm
29
+ npm run dev
30
+
31
+ # pnpm
32
+ pnpm run dev
33
+
34
+ # yarn
35
+ yarn dev
36
+
37
+ # bun
38
+ bun run dev
39
+ ```
40
+
41
+ ## Production
42
+
43
+ Build the application for production:
44
+
45
+ ```bash
46
+ # npm
47
+ npm run build
48
+
49
+ # pnpm
50
+ pnpm run build
51
+
52
+ # yarn
53
+ yarn build
54
+
55
+ # bun
56
+ bun run build
57
+ ```
58
+
59
+ Locally preview production build:
60
+
61
+ ```bash
62
+ # npm
63
+ npm run preview
64
+
65
+ # pnpm
66
+ pnpm run preview
67
+
68
+ # yarn
69
+ yarn preview
70
+
71
+ # bun
72
+ bun run preview
73
+ ```
74
+
75
+ Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
@@ -1 +1 @@
1
- # button, alerts, dropdown
1
+ # button, alerts, dropdown
@@ -15,10 +15,18 @@ const props = defineProps<Props>()
15
15
 
16
16
  const appConfig = useAppConfig()
17
17
  const loginUrl = appConfig.myLayer.loginUrl
18
+ const authMode = appConfig.myLayer.authMode
18
19
  const device = useAdaptive()
19
20
  const { t, locale } = useI18n()
20
21
 
22
+ const { loginModal } = useIdModals()
23
+
21
24
  function goAuth() {
25
+ if (authMode === 'local') {
26
+ loginModal.value = true
27
+ return
28
+ }
29
+
22
30
  if (window) {
23
31
  if (props.to) {
24
32
  navigateToLocalizedPage(props.to)
@@ -0,0 +1,104 @@
1
+ <script setup lang="ts">
2
+ import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
3
+
4
+ const props = defineProps<{
5
+ balance: number
6
+ }>()
7
+
8
+ const { $toast } = useNuxtApp()
9
+ const { t, locale } = useI18n()
10
+ const { commonAuth } = useAppConfig()
11
+ const accessToken = useCookie('accessToken')
12
+
13
+ const { topUpSidePanel } = usePayment()
14
+
15
+ const userApiURL = commonAuth.userApiURL
16
+
17
+ const isLoading = ref(false)
18
+
19
+ async function updateUserRate() {
20
+ try {
21
+ isLoading.value = true
22
+ await $fetch(`${removeTrailingSlash(userApiURL)}/user/rate`, {
23
+ method: 'PUT',
24
+ credentials: 'include',
25
+ headers: {
26
+ Authorization: `Bearer ${accessToken.value}`,
27
+ lang: locale.value,
28
+ },
29
+ body: {
30
+ rate_code: 'basic_plus',
31
+ },
32
+ })
33
+ window.location.reload()
34
+ }
35
+ catch (error) {
36
+ $toast.error(error.data.message)
37
+ }
38
+ finally {
39
+ isLoading.value = false
40
+ }
41
+ }
42
+
43
+ function onUpdate() {
44
+ if (props.balance >= 1000) {
45
+ updateUserRate()
46
+ }
47
+ else {
48
+ topUpSidePanel.value = true
49
+ }
50
+ }
51
+ </script>
52
+
53
+ <template>
54
+ <div class="gradient flex justify-between rounded-lg p-4 ring-1 ring-inset ring-blue-700/80 dark:bg-gray-800">
55
+ <div>
56
+ <p class="mb-2 font-semibold">
57
+ {{ t('modals.id.banners.basicPlusLimit.title') }}
58
+ </p>
59
+ <i18n-t
60
+ keypath="modals.id.banners.basicPlusLimit.subtitle"
61
+ tag="p"
62
+ class="text-sm text-gray-600 dark:text-gray-200"
63
+ >
64
+ <template #topUp>
65
+ <button
66
+ class="font-semibold text-blue-700 dark:text-blue-500"
67
+ @click="topUpSidePanel = true"
68
+ >
69
+ {{ t('modals.id.banners.basicPlusLimit.topUp') }}
70
+ </button>
71
+ </template>
72
+ </i18n-t>
73
+ </div>
74
+
75
+ <a-button
76
+ size="md"
77
+ class="self-end"
78
+ @click="onUpdate"
79
+ :loading="isLoading"
80
+ >
81
+ {{ t('actions.update') }}
82
+ </a-button>
83
+ </div>
84
+ </template>
85
+
86
+ <style scoped>
87
+ .gradient {
88
+ background: linear-gradient(
89
+ 239.71deg,
90
+ #B3D5F9 -7.48%,
91
+ #E6F1FD 39.62%,
92
+ #CCE2FB 85.82%
93
+ );
94
+ }
95
+
96
+ .dark .gradient {
97
+ background: linear-gradient(
98
+ 239.71deg,
99
+ #17303F -7.48%,
100
+ #161617 39.62%,
101
+ #17303F 85.82%
102
+ );
103
+ }
104
+ </style>
@@ -1,6 +1,5 @@
1
1
  <script setup lang="ts">
2
2
  import { buildLocalizedUrl } from '#adata-ui/utils/localizedNavigation'
3
- import PaymentProcess from '#adata-ui/components/features/payment/process/PaymentProcess.vue'
4
3
 
5
4
  const { t, locale } = useI18n()
6
5
  const { myLayer } = useAppConfig()
@@ -44,8 +43,6 @@ function onBuy() {
44
43
  {{ t('actions.buy') }}
45
44
  </a-button>
46
45
  </div>
47
-
48
- <payment-process />
49
46
  </template>
50
47
 
51
48
  <style scoped>
@@ -1 +1 @@
1
- # inputs
1
+ # inputs
@@ -12,16 +12,16 @@ function onRegister() {
12
12
  <div class="gradient flex justify-between rounded-lg p-4 ring-1 ring-inset ring-blue-700/80 dark:bg-gray-800">
13
13
  <div>
14
14
  <p class="mb-2 font-semibold">
15
- {{ t('modals.id.banner.title') }}
15
+ {{ t('modals.id.banners.auth.title') }}
16
16
  </p>
17
17
  <i18n-t
18
- keypath="modals.id.banner.subtitle"
18
+ keypath="modals.id.banners.auth.subtitle"
19
19
  tag="p"
20
20
  class="text-sm text-gray-600 dark:text-gray-200"
21
21
  >
22
22
  <template #register>
23
23
  <button class="font-semibold text-blue-700 dark:text-blue-500" @click="onRegister">
24
- {{ t('modals.id.banner.register') }}
24
+ {{ t('modals.id.banners.auth.register') }}
25
25
  </button>
26
26
  </template>
27
27
  </i18n-t>
@@ -1 +1 @@
1
- # breadcrumb, tabs
1
+ # breadcrumb, tabs
@@ -27,9 +27,16 @@ const { t } = useI18n()
27
27
  const { myLayer }: any = useAppConfig()
28
28
  const { locale } = useI18n()
29
29
 
30
+ // const { topUpSidePanel } = usePayment()
31
+
30
32
  const items = useHeaderMenuLinks()
31
33
 
32
34
  const onReplenish = () => {
35
+ // if (myLayer.authMode === 'locale') {
36
+ // topUpSidePanel.value = true
37
+ // return
38
+ // }
39
+
33
40
  if (window) {
34
41
  window.location.href =
35
42
  buildLocalizedUrl(locale.value, myLayer.landingUrl, '/profile?popupBalance=1')
@@ -1 +1 @@
1
- # tooltip, popover, slide over, modal, context menu
1
+ # tooltip, popover, slide over, modal, context menu
package/icons/sun.vue CHANGED
@@ -1,14 +1,14 @@
1
- <script setup lang="ts">
2
-
3
- </script>
4
-
5
- <template>
6
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="https://www.w3.org/2000/svg">
7
- <path opacity="0.4" d="M7.99998 12.6666C10.5773 12.6666 12.6666 10.5772 12.6666 7.99992C12.6666 5.42259 10.5773 3.33325 7.99998 3.33325C5.42265 3.33325 3.33331 5.42259 3.33331 7.99992C3.33331 10.5772 5.42265 12.6666 7.99998 12.6666Z" fill="#FBC920"/>
8
- <path d="M8.00002 15.3067C7.63335 15.3067 7.33335 15.0334 7.33335 14.6667V14.6134C7.33335 14.2467 7.63335 13.9467 8.00002 13.9467C8.36669 13.9467 8.66669 14.2467 8.66669 14.6134C8.66669 14.9801 8.36669 15.3067 8.00002 15.3067ZM12.76 13.4267C12.5867 13.4267 12.42 13.3601 12.2867 13.2334L12.2 13.1467C11.94 12.8867 11.94 12.4667 12.2 12.2067C12.46 11.9467 12.88 11.9467 13.14 12.2067L13.2267 12.2934C13.4867 12.5534 13.4867 12.9734 13.2267 13.2334C13.1 13.3601 12.9334 13.4267 12.76 13.4267ZM3.24002 13.4267C3.06669 13.4267 2.90002 13.3601 2.76669 13.2334C2.50669 12.9734 2.50669 12.5534 2.76669 12.2934L2.85335 12.2067C3.11335 11.9467 3.53335 11.9467 3.79335 12.2067C4.05335 12.4667 4.05335 12.8867 3.79335 13.1467L3.70669 13.2334C3.58002 13.3601 3.40669 13.4267 3.24002 13.4267ZM14.6667 8.66675H14.6134C14.2467 8.66675 13.9467 8.36675 13.9467 8.00008C13.9467 7.63341 14.2467 7.33342 14.6134 7.33342C14.98 7.33342 15.3067 7.63341 15.3067 8.00008C15.3067 8.36675 15.0334 8.66675 14.6667 8.66675ZM1.38669 8.66675H1.33335C0.966687 8.66675 0.666687 8.36675 0.666687 8.00008C0.666687 7.63341 0.966687 7.33342 1.33335 7.33342C1.70002 7.33342 2.02669 7.63341 2.02669 8.00008C2.02669 8.36675 1.75335 8.66675 1.38669 8.66675ZM12.6734 3.99341C12.5 3.99341 12.3334 3.92675 12.2 3.80008C11.94 3.54008 11.94 3.12008 12.2 2.86008L12.2867 2.77341C12.5467 2.51341 12.9667 2.51341 13.2267 2.77341C13.4867 3.03341 13.4867 3.45341 13.2267 3.71341L13.14 3.80008C13.0134 3.92675 12.8467 3.99341 12.6734 3.99341ZM3.32669 3.99341C3.15335 3.99341 2.98669 3.92675 2.85335 3.80008L2.76669 3.70675C2.50669 3.44675 2.50669 3.02675 2.76669 2.76675C3.02669 2.50675 3.44669 2.50675 3.70669 2.76675L3.79335 2.85342C4.05335 3.11342 4.05335 3.53341 3.79335 3.79341C3.66669 3.92675 3.49335 3.99341 3.32669 3.99341ZM8.00002 2.02675C7.63335 2.02675 7.33335 1.75341 7.33335 1.38675V1.33341C7.33335 0.966748 7.63335 0.666748 8.00002 0.666748C8.36669 0.666748 8.66669 0.966748 8.66669 1.33341C8.66669 1.70008 8.36669 2.02675 8.00002 2.02675Z" fill="#FBC920"/>
9
- </svg>
10
- </template>
11
-
12
- <style scoped>
13
-
14
- </style>
1
+ <script setup lang="ts">
2
+
3
+ </script>
4
+
5
+ <template>
6
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="https://www.w3.org/2000/svg">
7
+ <path opacity="0.4" d="M7.99998 12.6666C10.5773 12.6666 12.6666 10.5772 12.6666 7.99992C12.6666 5.42259 10.5773 3.33325 7.99998 3.33325C5.42265 3.33325 3.33331 5.42259 3.33331 7.99992C3.33331 10.5772 5.42265 12.6666 7.99998 12.6666Z" fill="#FBC920"/>
8
+ <path d="M8.00002 15.3067C7.63335 15.3067 7.33335 15.0334 7.33335 14.6667V14.6134C7.33335 14.2467 7.63335 13.9467 8.00002 13.9467C8.36669 13.9467 8.66669 14.2467 8.66669 14.6134C8.66669 14.9801 8.36669 15.3067 8.00002 15.3067ZM12.76 13.4267C12.5867 13.4267 12.42 13.3601 12.2867 13.2334L12.2 13.1467C11.94 12.8867 11.94 12.4667 12.2 12.2067C12.46 11.9467 12.88 11.9467 13.14 12.2067L13.2267 12.2934C13.4867 12.5534 13.4867 12.9734 13.2267 13.2334C13.1 13.3601 12.9334 13.4267 12.76 13.4267ZM3.24002 13.4267C3.06669 13.4267 2.90002 13.3601 2.76669 13.2334C2.50669 12.9734 2.50669 12.5534 2.76669 12.2934L2.85335 12.2067C3.11335 11.9467 3.53335 11.9467 3.79335 12.2067C4.05335 12.4667 4.05335 12.8867 3.79335 13.1467L3.70669 13.2334C3.58002 13.3601 3.40669 13.4267 3.24002 13.4267ZM14.6667 8.66675H14.6134C14.2467 8.66675 13.9467 8.36675 13.9467 8.00008C13.9467 7.63341 14.2467 7.33342 14.6134 7.33342C14.98 7.33342 15.3067 7.63341 15.3067 8.00008C15.3067 8.36675 15.0334 8.66675 14.6667 8.66675ZM1.38669 8.66675H1.33335C0.966687 8.66675 0.666687 8.36675 0.666687 8.00008C0.666687 7.63341 0.966687 7.33342 1.33335 7.33342C1.70002 7.33342 2.02669 7.63341 2.02669 8.00008C2.02669 8.36675 1.75335 8.66675 1.38669 8.66675ZM12.6734 3.99341C12.5 3.99341 12.3334 3.92675 12.2 3.80008C11.94 3.54008 11.94 3.12008 12.2 2.86008L12.2867 2.77341C12.5467 2.51341 12.9667 2.51341 13.2267 2.77341C13.4867 3.03341 13.4867 3.45341 13.2267 3.71341L13.14 3.80008C13.0134 3.92675 12.8467 3.99341 12.6734 3.99341ZM3.32669 3.99341C3.15335 3.99341 2.98669 3.92675 2.85335 3.80008L2.76669 3.70675C2.50669 3.44675 2.50669 3.02675 2.76669 2.76675C3.02669 2.50675 3.44669 2.50675 3.70669 2.76675L3.79335 2.85342C4.05335 3.11342 4.05335 3.53341 3.79335 3.79341C3.66669 3.92675 3.49335 3.99341 3.32669 3.99341ZM8.00002 2.02675C7.63335 2.02675 7.33335 1.75341 7.33335 1.38675V1.33341C7.33335 0.966748 7.63335 0.666748 8.00002 0.666748C8.36669 0.666748 8.66669 0.966748 8.66669 1.33341C8.66669 1.70008 8.36669 2.02675 8.00002 2.02675Z" fill="#FBC920"/>
9
+ </svg>
10
+ </template>
11
+
12
+ <style scoped>
13
+
14
+ </style>
package/lang/en.ts CHANGED
@@ -480,14 +480,22 @@ const EnLocale: RuLocale = {
480
480
  set: 'Set',
481
481
  resend: 'Resend',
482
482
  confirm: 'Confirm',
483
- "topUp": "Top up"
483
+ "topUp": "Top up",
484
+ update: 'Update',
484
485
  },
485
486
  modals: {
486
487
  id: {
487
- "banner": {
488
- "title": "Free checks",
489
- "subtitle": "{register} and get 5 free checks",
490
- "register": "Register"
488
+ "banners": {
489
+ auth: {
490
+ "title": "Free checks",
491
+ "subtitle": "{register} and get 5 free checks",
492
+ "register": "Register"
493
+ },
494
+ "basicPlusLimit": {
495
+ "title": "Your limit of checks under the 'Basic +' plan has been exhausted",
496
+ "subtitle": "{topUp} your balance and get access to additional checks",
497
+ "topUp": "Top up"
498
+ }
491
499
  },
492
500
  login: {
493
501
  title: 'Login',
package/lang/kk.ts CHANGED
@@ -482,13 +482,21 @@ const KkLocale: RuLocale = {
482
482
  resend: 'Қайта жіберу',
483
483
  confirm: 'Растау',
484
484
  "topUp": "Толықтыру",
485
+ update: 'Жаңарту',
485
486
  },
486
487
  modals: {
487
488
  id: {
488
- "banner": {
489
- "title": "Тегін тексерулер",
490
- "subtitle": "{register} және 5 тегін тексеру алыңыз",
491
- "register": "Тіркеліңіз"
489
+ "banners": {
490
+ auth: {
491
+ "title": "Тегін тексерулер",
492
+ "subtitle": "{register} және 5 тегін тексеру алыңыз",
493
+ "register": "Тіркеліңіз"
494
+ },
495
+ "basicPlusLimit": {
496
+ "title": "«Базалық +» тарифі бойынша тексеру лимитіңіз таусылды",
497
+ "subtitle": "{topUp} балансты толықтырып, қосымша тексерулерге қол жеткізіңіз",
498
+ "topUp": "Толықтырыңыз"
499
+ }
492
500
  },
493
501
  login: {
494
502
  title: 'Кіру',
package/lang/ru.ts CHANGED
@@ -483,13 +483,21 @@ const RuLocale = {
483
483
  resend: 'Отправить еще раз',
484
484
  confirm: 'Подтвердить',
485
485
  topUp: 'Пополнить',
486
+ update: 'Обновить',
486
487
  },
487
488
  modals: {
488
489
  id: {
489
- banner: {
490
- title: 'Бесплатные проверки',
491
- subtitle: '{register} и получите 5 бесплатных проверок',
492
- register: 'Зарегистрируйтесь',
490
+ banners: {
491
+ auth: {
492
+ title: 'Бесплатные проверки',
493
+ subtitle: '{register} и получите 5 бесплатных проверок',
494
+ register: 'Зарегистрируйтесь',
495
+ },
496
+ basicPlusLimit: {
497
+ title: 'Ваш лимит проверок по тарифу «Базовый +» исчерпан',
498
+ subtitle: '{topUp} баланс и получите доступ к дополнительным проверкам',
499
+ topUp: 'Пополните',
500
+ }
493
501
  },
494
502
  login: {
495
503
  title: 'Вход',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adata-ui",
3
3
  "type": "module",
4
- "version": "2.0.47",
4
+ "version": "2.0.48",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",