adata-ui 2.0.78 → 2.0.79

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
@@ -1 +1 @@
1
- # inputs
1
+ # inputs
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ const { t } = useI18n()
3
+
4
+ const { loginModal, autoLogoutModal } = useIdModals()
5
+
6
+ function onLogin() {
7
+ autoLogoutModal.value = false
8
+ loginModal.value = true
9
+ }
10
+
11
+ function onClose() {
12
+ autoLogoutModal.value = false
13
+ }
14
+ </script>
15
+
16
+ <template>
17
+ <div class="flex flex-col items-center gap-4 text-center">
18
+ <h2 class="text-2xl font-bold">
19
+ {{ t('modals.id.autoLogout.title') }}
20
+ </h2>
21
+ <a-ill-info class="size-[120px]" />
22
+ <p class="text-sm">
23
+ {{ t('modals.id.autoLogout.content') }}
24
+ </p>
25
+ <div class="flex w-full gap-2">
26
+ <a-button block view="outline" @click="onClose">
27
+ {{ t('actions.close') }}
28
+ </a-button>
29
+ <a-button
30
+ block
31
+ @click="onLogin"
32
+ >
33
+ {{ t('actions.login') }}
34
+ </a-button>
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <style scoped>
40
+
41
+ </style>
@@ -43,6 +43,7 @@ async function loginUser() {
43
43
  if (cookiesData) {
44
44
  const { access_token, expire_in } = cookiesData
45
45
  const hostname = location.hostname.split('.').reverse()
46
+ useCookie('autoLogout').value = true
46
47
 
47
48
  useCookie('accessToken', {
48
49
  maxAge: expire_in,
@@ -121,6 +121,7 @@ async function submit() {
121
121
  if (cookiesData) {
122
122
  const { access_token, expire_in } = cookiesData
123
123
  const hostname = location.hostname.split('.').reverse()
124
+ useCookie('autoLogout').value = true
124
125
 
125
126
  useCookie('accessToken', {
126
127
  maxAge: expire_in,
@@ -9,6 +9,7 @@ import IdRecoveryModal from '#adata-ui/components/modals/id/IdRecoveryModal.vue'
9
9
  import IdRegistrationModal from '#adata-ui/components/modals/id/IdRegistrationModal.vue'
10
10
  import IdResetPasswordOtpModal from '#adata-ui/components/modals/id/IdResetPasswordOtpModal.vue'
11
11
  import IdTwoFactorModal from '#adata-ui/components/modals/id/IdTwoFactorModal.vue'
12
+ import IdAutoLogoutModal from '#adata-ui/components/modals/id/IdAutoLogoutModal.vue'
12
13
 
13
14
  const {
14
15
  loginModal,
@@ -20,15 +21,17 @@ const {
20
21
  passwordSuccessfulModal,
21
22
  confirmSuccessfulModal,
22
23
  twoFactorModal,
24
+ autoLogoutModal
23
25
  } = useIdModals()
24
26
 
25
27
  const { locale } = useI18n()
26
28
  const { commonAuth } = useAppConfig()
27
29
  const authApiURL = commonAuth.authApiURL
28
30
 
29
- onMounted(async () => {
30
- const accessToken = useCookie('accessToken')
31
+ const accessToken = useCookie('accessToken')
32
+ const isAuthenticated = computed(() => !!accessToken.value)
31
33
 
34
+ onMounted(async () => {
32
35
  const response = await fetch(`${removeTrailingSlash(authApiURL)}/access/cookie`, {
33
36
  method: 'GET',
34
37
  credentials: 'include',
@@ -40,6 +43,7 @@ onMounted(async () => {
40
43
  if (cookiesData?.access_token && !accessToken.value) {
41
44
  const { access_token, expire_in } = cookiesData
42
45
  const hostname = location.hostname.split('.').reverse()
46
+ useCookie('autoLogout').value = true
43
47
 
44
48
  useCookie('accessToken', {
45
49
  maxAge: expire_in,
@@ -51,6 +55,15 @@ onMounted(async () => {
51
55
  window.location.reload()
52
56
  }
53
57
  })
58
+
59
+ watch(isAuthenticated, (val) => {
60
+ const autoLogout = useCookie('autoLogout')
61
+
62
+ if (!val && autoLogout.value) {
63
+ autoLogoutModal.value = true
64
+ autoLogout.value = null
65
+ }
66
+ })
54
67
  </script>
55
68
 
56
69
  <template>
@@ -83,6 +96,10 @@ onMounted(async () => {
83
96
  <a-modal v-model="passwordSuccessfulModal" prevent-close>
84
97
  <id-password-successful-modal v-if="passwordSuccessfulModal" />
85
98
  </a-modal>
99
+
100
+ <a-modal v-model="autoLogoutModal" prevent-close>
101
+ <id-auto-logout-modal v-if="autoLogoutModal" />
102
+ </a-modal>
86
103
  </template>
87
104
 
88
105
  <style scoped></style>
@@ -55,6 +55,7 @@ async function onConfirm() {
55
55
  if (cookiesData?.access_token) {
56
56
  const { access_token, expire_in } = cookiesData
57
57
  const hostname = location.hostname.split('.').reverse()
58
+ useCookie('autoLogout').value = true
58
59
 
59
60
  useCookie('accessToken', {
60
61
  maxAge: expire_in,
@@ -1 +1 @@
1
- # breadcrumb, tabs
1
+ # breadcrumb, tabs
@@ -1 +1 @@
1
- # tooltip, popover, slide over, modal, context menu
1
+ # tooltip, popover, slide over, modal, context menu
@@ -11,6 +11,8 @@ export function useIdModals() {
11
11
  const newPasswordModal = useState('new-password-modal', () => false)
12
12
  const passwordSuccessfulModal = useState('password-successful-modal', () => false)
13
13
 
14
+ const autoLogoutModal = useState('auto-logout-modal', () => false)
15
+
14
16
  const intermediateState = useState('id-intermediate-state', () => ({
15
17
  email: '',
16
18
  password: '',
@@ -28,6 +30,7 @@ export function useIdModals() {
28
30
  newPasswordModal,
29
31
  passwordSuccessfulModal,
30
32
  confirmSuccessfulModal,
33
+ autoLogoutModal,
31
34
  intermediateState,
32
35
  }
33
36
  }
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="http://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="http://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
@@ -568,6 +568,10 @@ const EnLocale: RuLocale = {
568
568
  title: 'Success!',
569
569
  content: 'Email has been confirmed. Thank you!',
570
570
  },
571
+ autoLogout: {
572
+ title: 'Information',
573
+ content: 'For security reasons, an automatic account logout was performed.',
574
+ },
571
575
  },
572
576
  auth: {
573
577
  title: 'No Access',
package/lang/kk.ts CHANGED
@@ -569,6 +569,10 @@ const KkLocale: RuLocale = {
569
569
  title: 'Сәтті!',
570
570
  content: 'Электрондық пошта расталды. Рахмет!',
571
571
  },
572
+ autoLogout: {
573
+ title: 'Ақпарат',
574
+ content: 'Қауіпсіздік мақсатында есептік жазбадан автоматты түрде шығу орындалды',
575
+ },
572
576
  },
573
577
  auth: {
574
578
  title: 'Қол жеткізу жоқ',
package/lang/ru.ts CHANGED
@@ -570,6 +570,10 @@ const RuLocale = {
570
570
  title: 'Успешно!',
571
571
  content: 'Электронная почта подтверждена. Спасибо!',
572
572
  },
573
+ autoLogout: {
574
+ title: 'Информация',
575
+ content: 'В целях безопасности был выполнен автоматический выход из аккаунта',
576
+ },
573
577
  },
574
578
  auth: {
575
579
  title: 'Нет доступа',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adata-ui",
3
3
  "type": "module",
4
- "version": "2.0.78",
4
+ "version": "2.0.79",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",