adata-ui 2.0.39 → 2.0.41
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/app.config.ts +1 -0
- package/components/features/payment/banner/PaymentBanner.vue +69 -0
- package/components/features/payment/process/PaymentKaspiQrSidePanel.vue +158 -0
- package/components/features/payment/process/PaymentKaspiRedirectSidePanel.vue +112 -0
- package/components/features/payment/process/PaymentMethodSidePanel.vue +117 -0
- package/components/features/payment/process/PaymentProcess.vue +136 -0
- package/components/features/payment/process/PaymentTopUpSidePanel.vue +113 -0
- package/components/modals/id/IdBanner.vue +58 -0
- package/components/modals/id/IdConfirmAccountOtpModal.vue +2 -6
- package/components/modals/id/IdLoginModal.vue +2 -6
- package/components/modals/id/IdModals.vue +1 -1
- package/components/modals/id/IdNewPasswordModal.vue +2 -6
- package/components/modals/id/IdRecoveryModal.vue +2 -6
- package/components/modals/id/IdRegistrationModal.vue +3 -8
- package/components/modals/id/IdResetPasswordOtpModal.vue +2 -6
- package/components/modals/id/IdTwoFactorModal.vue +2 -6
- package/components/overlays/side-panel/ASidePanel.vue +439 -0
- package/composables/useBuyTariffs.ts +1 -1
- package/composables/useIdModals.ts +8 -0
- package/composables/usePayment.ts +72 -0
- package/icons/kaspi-qr.vue +13 -0
- package/lang/en.ts +46 -0
- package/lang/kk.ts +46 -0
- package/lang/ru.ts +46 -0
- package/nuxt.config.ts +13 -1
- package/package.json +5 -5
- package/public/kaspi/logo.svg +4 -0
- package/stores/auth.store.ts +0 -12
- /package/components/{modals/id/helpers → utils}/removeTrailingSlash.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { t } = useI18n()
|
|
3
|
+
|
|
4
|
+
const { registrationModal } = useIdModals()
|
|
5
|
+
|
|
6
|
+
function onRegister() {
|
|
7
|
+
registrationModal.value = true
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="gradient flex justify-between rounded-lg p-4 ring-1 ring-inset ring-blue-700/80 dark:bg-gray-800">
|
|
13
|
+
<div>
|
|
14
|
+
<p class="mb-2 font-semibold">
|
|
15
|
+
{{ t('modals.id.banner.title') }}
|
|
16
|
+
</p>
|
|
17
|
+
<i18n-t
|
|
18
|
+
keypath="modals.id.banner.subtitle"
|
|
19
|
+
tag="p"
|
|
20
|
+
class="text-sm text-gray-600 dark:text-gray-200"
|
|
21
|
+
>
|
|
22
|
+
<template #register>
|
|
23
|
+
<button class="font-semibold text-blue-700 dark:text-blue-500" @click="onRegister">
|
|
24
|
+
{{ t('modals.id.banner.register') }}
|
|
25
|
+
</button>
|
|
26
|
+
</template>
|
|
27
|
+
</i18n-t>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<a-button
|
|
31
|
+
size="md"
|
|
32
|
+
class="self-end"
|
|
33
|
+
@click="onRegister"
|
|
34
|
+
>
|
|
35
|
+
{{ t('actions.register') }}
|
|
36
|
+
</a-button>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<style scoped>
|
|
41
|
+
.gradient {
|
|
42
|
+
background: linear-gradient(
|
|
43
|
+
239.71deg,
|
|
44
|
+
#B3D5F9 -7.48%,
|
|
45
|
+
#E6F1FD 39.62%,
|
|
46
|
+
#CCE2FB 85.82%
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dark .gradient {
|
|
51
|
+
background: linear-gradient(
|
|
52
|
+
239.71deg,
|
|
53
|
+
#17303F -7.48%,
|
|
54
|
+
#161617 39.62%,
|
|
55
|
+
#17303F 85.82%
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
3
3
|
import IdOtpInput from '#adata-ui/components/modals/id/IdOtpInput.vue'
|
|
4
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
5
4
|
|
|
6
5
|
const { $toast } = useNuxtApp()
|
|
7
6
|
const { t, locale } = useI18n()
|
|
8
7
|
const { commonAuth } = useAppConfig()
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
12
|
-
|
|
13
|
-
const { confirmAccountOtpModal, confirmSuccessfulModal } = useIdModals()
|
|
9
|
+
const { confirmAccountOtpModal, confirmSuccessfulModal, intermediateState } = useIdModals()
|
|
14
10
|
|
|
15
11
|
const authApiURL = commonAuth.authApiURL
|
|
16
12
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
3
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
4
3
|
import { navigateToLocalizedPage } from '#adata-ui/utils/localizedNavigation'
|
|
5
4
|
import * as z from 'zod'
|
|
6
5
|
|
|
@@ -8,10 +7,7 @@ const { $toast } = useNuxtApp()
|
|
|
8
7
|
const { myLayer, commonAuth } = useAppConfig()
|
|
9
8
|
const { t, locale } = useI18n()
|
|
10
9
|
|
|
11
|
-
const
|
|
12
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
13
|
-
|
|
14
|
-
const { loginModal, registrationModal, recoveryModal, confirmAccountOtpModal, twoFactorModal } = useIdModals()
|
|
10
|
+
const { loginModal, registrationModal, recoveryModal, confirmAccountOtpModal, twoFactorModal, intermediateState } = useIdModals()
|
|
15
11
|
|
|
16
12
|
const authApiURL = commonAuth.authApiURL
|
|
17
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
3
3
|
import IdConfirmAccountOtpModal from '#adata-ui/components/modals/id/IdConfirmAccountOtpModal.vue'
|
|
4
4
|
import IdConfirmSuccessfulModal from '#adata-ui/components/modals/id/IdConfirmSuccessfulModal.vue'
|
|
5
5
|
import IdLoginModal from '#adata-ui/components/modals/id/IdLoginModal.vue'
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
3
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
4
3
|
import * as z from 'zod'
|
|
5
4
|
|
|
6
5
|
const { $toast } = useNuxtApp()
|
|
7
6
|
const { commonAuth } = useAppConfig()
|
|
8
7
|
const { t, locale } = useI18n()
|
|
9
8
|
|
|
10
|
-
const authStore = useAuthStore()
|
|
11
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
12
|
-
|
|
13
9
|
const authApiURL = commonAuth.authApiURL
|
|
14
|
-
const { newPasswordModal, passwordSuccessfulModal } = useIdModals()
|
|
10
|
+
const { newPasswordModal, passwordSuccessfulModal, intermediateState } = useIdModals()
|
|
15
11
|
|
|
16
12
|
const form = reactive({
|
|
17
13
|
password: '',
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
3
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
4
3
|
import * as z from 'zod'
|
|
5
4
|
|
|
6
5
|
const { $toast } = useNuxtApp()
|
|
7
6
|
const { commonAuth } = useAppConfig()
|
|
8
7
|
const { t, locale } = useI18n()
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
12
|
-
|
|
13
|
-
const { recoveryModal, resetPasswordOtpModal } = useIdModals()
|
|
9
|
+
const { recoveryModal, resetPasswordOtpModal, intermediateState } = useIdModals()
|
|
14
10
|
const authApiURL = commonAuth.authApiURL
|
|
15
11
|
const emailField = ref('')
|
|
16
12
|
const loading = ref(false)
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
3
3
|
import { PAGES } from '#adata-ui/shared/constans/pages'
|
|
4
|
-
|
|
5
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
6
|
-
import { computed, reactive, ref } from 'vue'
|
|
7
4
|
import * as z from 'zod'
|
|
8
5
|
|
|
9
6
|
const { $toast } = useNuxtApp()
|
|
10
7
|
const route = useRoute()
|
|
11
8
|
|
|
12
|
-
const authStore = useAuthStore()
|
|
13
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
14
|
-
|
|
15
9
|
const localePath = useLocalePath()
|
|
16
10
|
const { t, locale } = useI18n()
|
|
17
11
|
const { myLayer, commonAuth }: any = useAppConfig()
|
|
18
12
|
const authApiURL = commonAuth.authApiURL
|
|
19
13
|
const redirectUrl = useCookie('redirect_url')
|
|
20
|
-
const { loginModal, registrationModal, confirmAccountOtpModal } = useIdModals()
|
|
14
|
+
const { loginModal, registrationModal, confirmAccountOtpModal, intermediateState } = useIdModals()
|
|
21
15
|
|
|
22
16
|
export interface RegistrationForm {
|
|
23
17
|
email: string
|
|
@@ -186,6 +180,7 @@ onBeforeUnmount(() => {
|
|
|
186
180
|
<a-checkbox
|
|
187
181
|
v-model="agreement"
|
|
188
182
|
side="right"
|
|
183
|
+
name="confirm-agreement"
|
|
189
184
|
>
|
|
190
185
|
<i18n-t keypath="modals.id.register.agreement.text">
|
|
191
186
|
<template #link>
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
3
3
|
import IdOtpInput from '#adata-ui/components/modals/id/IdOtpInput.vue'
|
|
4
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
5
4
|
|
|
6
5
|
const { $toast } = useNuxtApp()
|
|
7
6
|
const { t, locale } = useI18n()
|
|
8
7
|
const { commonAuth } = useAppConfig()
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
12
|
-
|
|
13
|
-
const { resetPasswordOtpModal, newPasswordModal } = useIdModals()
|
|
9
|
+
const { resetPasswordOtpModal, newPasswordModal, intermediateState } = useIdModals()
|
|
14
10
|
|
|
15
11
|
const authApiURL = commonAuth.authApiURL
|
|
16
12
|
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { removeTrailingSlash } from '#adata-ui/components/
|
|
2
|
+
import { removeTrailingSlash } from '#adata-ui/components/utils/removeTrailingSlash'
|
|
3
3
|
import IdOtpInput from '#adata-ui/components/modals/id/IdOtpInput.vue'
|
|
4
|
-
import { useAuthStore } from '#adata-ui/stores/auth.store'
|
|
5
4
|
|
|
6
5
|
const { $toast } = useNuxtApp()
|
|
7
6
|
const { t, locale } = useI18n()
|
|
8
7
|
const { commonAuth } = useAppConfig()
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
const { intermediateState } = storeToRefs(authStore)
|
|
12
|
-
|
|
13
|
-
const { twoFactorModal } = useIdModals()
|
|
9
|
+
const { twoFactorModal, intermediateState } = useIdModals()
|
|
14
10
|
|
|
15
11
|
const authApiURL = commonAuth.authApiURL
|
|
16
12
|
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {disableBodyScroll, enableBodyScroll} from 'body-scroll-lock';
|
|
3
|
+
import {useAdaptive} from "~/composables/useAdaptive";
|
|
4
|
+
|
|
5
|
+
type Side = 'top' | 'right' | 'bottom' | 'left'
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
idName?: string
|
|
8
|
+
hideCloseBtn?: boolean
|
|
9
|
+
noClose?: boolean
|
|
10
|
+
side?: Side
|
|
11
|
+
rerender?: boolean
|
|
12
|
+
zIndex?: number | 'auto'
|
|
13
|
+
width?: string
|
|
14
|
+
height?: string
|
|
15
|
+
lockScroll?: boolean
|
|
16
|
+
lockScrollHtml?: boolean
|
|
17
|
+
hideScrollbar?: boolean
|
|
18
|
+
overlayColor?: string
|
|
19
|
+
overlayOpacity?: number
|
|
20
|
+
overlayDuration?: number
|
|
21
|
+
panelColor?: string
|
|
22
|
+
panelDuration?: number
|
|
23
|
+
transitionName?: string
|
|
24
|
+
headerClass?: string
|
|
25
|
+
bodyClass?: string
|
|
26
|
+
footerClass?: string
|
|
27
|
+
}>(), {
|
|
28
|
+
idName: "vsp-container",
|
|
29
|
+
side: "right",
|
|
30
|
+
zIndex: "auto",
|
|
31
|
+
width: "auto",
|
|
32
|
+
height: "auto",
|
|
33
|
+
lockScroll: true,
|
|
34
|
+
hideScrollbar: false,
|
|
35
|
+
overlayColor: "black",
|
|
36
|
+
overlayOpacity: 0.5,
|
|
37
|
+
overlayDuration: 500,
|
|
38
|
+
panelColor: "bg-white dark:bg-gray-900",
|
|
39
|
+
panelDuration: 300
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
defineEmits<{
|
|
43
|
+
(e: 'opened'): void
|
|
44
|
+
(e: 'closed'): void
|
|
45
|
+
}>()
|
|
46
|
+
const modelValue = defineModel()
|
|
47
|
+
|
|
48
|
+
let teleportContainer: HTMLDivElement | undefined = undefined
|
|
49
|
+
const panel = ref<HTMLElement | null>(null)
|
|
50
|
+
const overlay = ref<HTMLElement | null>(null)
|
|
51
|
+
const footer = ref<HTMLElement | null>(null)
|
|
52
|
+
const header = ref<HTMLElement | null>(null)
|
|
53
|
+
const body = ref<HTMLElement | null>(null)
|
|
54
|
+
const panelSide = ref<Side>(props.side)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const device = useAdaptive()
|
|
58
|
+
|
|
59
|
+
const zIndex = ref<number>();
|
|
60
|
+
const isBodyAlreadyLocked = ref(false);
|
|
61
|
+
|
|
62
|
+
const attrs = useAttrs()
|
|
63
|
+
|
|
64
|
+
const closePanel = () => modelValue.value = false
|
|
65
|
+
|
|
66
|
+
const lockUnlockBodyScroll = (elem: HTMLElement, lock: boolean) => {
|
|
67
|
+
if (lock) {
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
disableBodyScroll(elem, {
|
|
70
|
+
reserveScrollBarGap: true,
|
|
71
|
+
allowTouchMove: elem && elem !== document.body
|
|
72
|
+
})
|
|
73
|
+
disableBodyScroll(elem, {reserveScrollBarGap: true})
|
|
74
|
+
if (props.lockScrollHtml) document.documentElement.style.overflow = 'hidden'
|
|
75
|
+
}, 0)
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
enableBodyScroll(elem)
|
|
79
|
+
if (props.lockScrollHtml) document.documentElement.style.removeProperty('overflow')
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const getMaxZIndex = () =>
|
|
83
|
+
Math.max(
|
|
84
|
+
...Array.from(document.querySelectorAll('body *'), (el) =>
|
|
85
|
+
parseFloat(window.getComputedStyle(el).zIndex),
|
|
86
|
+
).filter((zIndex) => !Number.isNaN(zIndex)),
|
|
87
|
+
0,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
onMounted(() => {
|
|
91
|
+
zIndex.value = props.zIndex === 'auto' ? getMaxZIndex() : props.zIndex
|
|
92
|
+
|
|
93
|
+
const alreadyCreatedTarget = document.getElementById(props.idName)
|
|
94
|
+
if (!!alreadyCreatedTarget) return
|
|
95
|
+
teleportContainer = document.createElement('div')
|
|
96
|
+
teleportContainer.setAttribute('id', props.idName)
|
|
97
|
+
document.body.appendChild(teleportContainer)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
onBeforeUnmount(() => {
|
|
101
|
+
if (props.lockScroll && panel.value && modelValue.value) lockUnlockBodyScroll(panel.value, false)
|
|
102
|
+
if (teleportContainer) document.body.removeChild(teleportContainer)
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
watch(() => device.value, () => {
|
|
106
|
+
panelSide.value = device.value.isTablet || device.value.isSmallTablet ? 'bottom': props.side
|
|
107
|
+
}, { immediate: true })
|
|
108
|
+
|
|
109
|
+
watch(() => [modelValue.value, panel.value], (newP, oldP) => {
|
|
110
|
+
const wasShown = oldP ? (oldP[0] as boolean) : false
|
|
111
|
+
const [isShown, panelEl] = newP
|
|
112
|
+
const isOpening = isShown
|
|
113
|
+
const isClosing = wasShown && !isShown
|
|
114
|
+
if (!panelEl) return
|
|
115
|
+
if (isOpening) isBodyAlreadyLocked.value = !!document.body.style.overflow
|
|
116
|
+
|
|
117
|
+
if (isShown) {
|
|
118
|
+
if (props.lockScroll) lockUnlockBodyScroll(panelEl, true)
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!props.lockScroll || !isClosing || isBodyAlreadyLocked.value) return;
|
|
123
|
+
|
|
124
|
+
setTimeout(() => {
|
|
125
|
+
if (panelEl) lockUnlockBodyScroll(panelEl, false)
|
|
126
|
+
}, props.panelDuration)
|
|
127
|
+
}, {immediate: true})
|
|
128
|
+
|
|
129
|
+
const roundedClass = computed(() => {
|
|
130
|
+
const classes = {
|
|
131
|
+
left: "rounded-r-xl",
|
|
132
|
+
right: "rounded-l-xl",
|
|
133
|
+
top: "rounded-b-xl",
|
|
134
|
+
bottom: "rounded-t-xl",
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return classes[panelSide.value]
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const overlayStyles = computed(() => ({
|
|
141
|
+
zIndex: zIndex.value,
|
|
142
|
+
animationDuration: `${props.overlayDuration}ms`,
|
|
143
|
+
'--overlay-opacity': props.overlayOpacity,
|
|
144
|
+
opacity: modelValue.value ? props.overlayOpacity : 0,
|
|
145
|
+
backgroundColor: props.overlayColor,
|
|
146
|
+
pointerEvents: !modelValue.value ? 'none' : 'all',
|
|
147
|
+
}));
|
|
148
|
+
|
|
149
|
+
const panelStyles = computed(() => ({
|
|
150
|
+
width: ['left', 'right'].includes(panelSide.value) ? props.width : undefined,
|
|
151
|
+
maxWidth: '100%',
|
|
152
|
+
|
|
153
|
+
...(['top', 'bottom'].includes(panelSide.value)
|
|
154
|
+
? {
|
|
155
|
+
height: device.value.isSmallTablet || device.value.isTablet ? '100%' : props.height,
|
|
156
|
+
maxHeight: device.value.isMobile ? '90%': '100%',
|
|
157
|
+
}
|
|
158
|
+
: {}),
|
|
159
|
+
|
|
160
|
+
zIndex: zIndex.value,
|
|
161
|
+
animationDuration: `${props.panelDuration}ms`,
|
|
162
|
+
|
|
163
|
+
...Object.assign({}, attrs.style),
|
|
164
|
+
}));
|
|
165
|
+
// Mobile swipe
|
|
166
|
+
const positionStart = ref<number>(0)
|
|
167
|
+
const isClose = ref<boolean>(false)
|
|
168
|
+
const modalHeight = ref(0)
|
|
169
|
+
|
|
170
|
+
const touchstart = (event: TouchEvent) => {
|
|
171
|
+
isClose.value = false
|
|
172
|
+
positionStart.value = event.touches[0].clientY
|
|
173
|
+
modalHeight.value = panel.value?.offsetHeight || 0 // Запоминаем текущую высоту модалки
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const touchmove = (event: TouchEvent) => {
|
|
177
|
+
if (!device.value.isSmallTablet && !device.value.isTablet) return
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
const touchPosition = event.touches[0].clientY
|
|
180
|
+
const step = touchPosition - positionStart.value
|
|
181
|
+
|
|
182
|
+
if (step < 0) return // предотвратить движение вверх
|
|
183
|
+
|
|
184
|
+
const newHeight = modalHeight.value - step
|
|
185
|
+
panel.value.style.height = `${newHeight}px`
|
|
186
|
+
isClose.value = step > 65
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const touchend = () => {
|
|
190
|
+
if (isClose.value) {
|
|
191
|
+
closePanel()
|
|
192
|
+
} else {
|
|
193
|
+
panel.value.style.height = `${modalHeight.value}px`
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
</script>
|
|
197
|
+
|
|
198
|
+
<template>
|
|
199
|
+
<client-only>
|
|
200
|
+
<Teleport :to="`#${idName}`">
|
|
201
|
+
<div class="vsp-wrapper" :class="[modelValue && 'vsp-wrapper--active']">
|
|
202
|
+
<Transition name="overlay">
|
|
203
|
+
<div
|
|
204
|
+
v-show="modelValue"
|
|
205
|
+
ref="overlay"
|
|
206
|
+
class="vsp-overlay fixed top-0 left-0 w-full h-full"
|
|
207
|
+
:style="overlayStyles"
|
|
208
|
+
@click="() => (noClose ? undefined: closePanel())"
|
|
209
|
+
/>
|
|
210
|
+
</Transition>
|
|
211
|
+
<Transition
|
|
212
|
+
:name="transitionName || `slide-${panelSide}`"
|
|
213
|
+
@after-enter="$emit('opened')"
|
|
214
|
+
@after-leave="$emit('closed')">
|
|
215
|
+
<div
|
|
216
|
+
v-if="rerender ? modelValue : true"
|
|
217
|
+
v-show="rerender ? true: modelValue"
|
|
218
|
+
ref="panel"
|
|
219
|
+
class="vsp fixed flex flex-col"
|
|
220
|
+
:class="[`vsp--${panelSide}-side`, $attrs.class, roundedClass, panelColor]"
|
|
221
|
+
:style="panelStyles"
|
|
222
|
+
>
|
|
223
|
+
<div
|
|
224
|
+
class="w-full flex justify-center items-center mt-1 lg:hidden"
|
|
225
|
+
@touchmove="touchmove"
|
|
226
|
+
@touchstart="touchstart"
|
|
227
|
+
@touchend="touchend"
|
|
228
|
+
>
|
|
229
|
+
<div class="h-1 w-10 bg-[#D9D9D9] rounded m-1" />
|
|
230
|
+
</div>
|
|
231
|
+
<div
|
|
232
|
+
:class="roundedClass"
|
|
233
|
+
class="absolute w-8 px-2 py-4 bg-blue-700 text-white -left-8 top-8 cursor-pointer lg:block hidden"
|
|
234
|
+
v-if="!hideCloseBtn"
|
|
235
|
+
@click="closePanel"
|
|
236
|
+
>
|
|
237
|
+
<a-icon-x-mark />
|
|
238
|
+
</div>
|
|
239
|
+
<div v-if="!!$slots.header" ref="header"
|
|
240
|
+
@touchmove="touchmove"
|
|
241
|
+
@touchstart="touchstart"
|
|
242
|
+
@touchend="touchend"
|
|
243
|
+
:class="[headerClass, 'vsp__header border-b border-deepblue-100 dark:border-[#E3E5E80D] lg:px-8 p-4']">
|
|
244
|
+
<slot name="header" :close="closePanel"/>
|
|
245
|
+
</div>
|
|
246
|
+
<div
|
|
247
|
+
ref="body"
|
|
248
|
+
:class="[
|
|
249
|
+
bodyClass,
|
|
250
|
+
'vsp__body overflow-y-auto relative flex-grow-1 h-full lg:px-8 p-4',
|
|
251
|
+
hideScrollbar ? 'vsp__body--hide-scroll' : '',
|
|
252
|
+
]"
|
|
253
|
+
>
|
|
254
|
+
<slot name="default" :close="closePanel"/>
|
|
255
|
+
</div>
|
|
256
|
+
<div v-if="!!$slots.footer" ref="footer"
|
|
257
|
+
:class="[footerClass, 'vsp__footer border-t border-deepblue-100 dark:border-[#E3E5E80D] lg:px-8 p-4']">
|
|
258
|
+
<slot name="footer"/>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</Transition>
|
|
262
|
+
</div>
|
|
263
|
+
</Teleport>
|
|
264
|
+
</client-only>
|
|
265
|
+
</template>
|
|
266
|
+
|
|
267
|
+
<style scoped lang="scss">
|
|
268
|
+
.vsp-wrapper {
|
|
269
|
+
.vsp {
|
|
270
|
+
&--right-side,
|
|
271
|
+
&--left-side {
|
|
272
|
+
top: 0;
|
|
273
|
+
height: 100%;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
&--right-side {
|
|
277
|
+
right: 0;
|
|
278
|
+
left: unset;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&--left-side {
|
|
282
|
+
right: unset;
|
|
283
|
+
left: 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&--bottom-side,
|
|
287
|
+
&--top-side {
|
|
288
|
+
left: 0;
|
|
289
|
+
width: 100%;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&--bottom-side {
|
|
293
|
+
bottom: 0;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&--top-side {
|
|
297
|
+
top: 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&__body {
|
|
301
|
+
&.overflow-y-auto::-webkit-scrollbar {
|
|
302
|
+
width: 8px;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
&.overflow-y-auto::-webkit-scrollbar-thumb {
|
|
306
|
+
background: #2C3E5033;
|
|
307
|
+
border-radius: 6px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&.vsp__body--hide-scroll {
|
|
311
|
+
scrollbar-width: none;
|
|
312
|
+
|
|
313
|
+
&::-webkit-scrollbar {
|
|
314
|
+
width: 0;
|
|
315
|
+
height: 0;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.overlay-enter-active,
|
|
322
|
+
.overlay-leave-active {
|
|
323
|
+
animation: overlay-transition;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.overlay-leave-active {
|
|
327
|
+
animation-direction: reverse;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.slide-right-enter-active,
|
|
331
|
+
.slide-right-leave-active {
|
|
332
|
+
animation: slide-right;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.slide-right-leave-active {
|
|
336
|
+
animation-direction: reverse;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.slide-left-enter-active,
|
|
340
|
+
.slide-left-leave-active {
|
|
341
|
+
animation: slide-left;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.slide-left-leave-active {
|
|
345
|
+
animation-direction: reverse;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.slide-top-enter-active,
|
|
349
|
+
.slide-top-leave-active {
|
|
350
|
+
animation: slide-left;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.slide-top-leave-active {
|
|
354
|
+
animation-direction: reverse;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.slide-top-enter-active,
|
|
358
|
+
.slide-top-leave-active {
|
|
359
|
+
animation: slide-top;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.slide-top-leave-active {
|
|
363
|
+
animation-direction: reverse;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.slide-bottom-enter-active,
|
|
367
|
+
.slide-bottom-leave-active {
|
|
368
|
+
animation: slide-bottom;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.slide-bottom-leave-active {
|
|
372
|
+
animation-direction: reverse;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
@keyframes slide-right {
|
|
376
|
+
0% {
|
|
377
|
+
transform: translateX(100%);
|
|
378
|
+
opacity: 0;
|
|
379
|
+
}
|
|
380
|
+
100% {
|
|
381
|
+
transform: translateX(0);
|
|
382
|
+
opacity: 1;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
@keyframes slide-left {
|
|
387
|
+
0% {
|
|
388
|
+
transform: translateX(-100%);
|
|
389
|
+
opacity: 0;
|
|
390
|
+
}
|
|
391
|
+
100% {
|
|
392
|
+
transform: translateX(0);
|
|
393
|
+
opacity: 1;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
@keyframes slide-bottom {
|
|
398
|
+
0% {
|
|
399
|
+
transform: translateY(100%);
|
|
400
|
+
opacity: 0;
|
|
401
|
+
}
|
|
402
|
+
100% {
|
|
403
|
+
transform: translateY(0);
|
|
404
|
+
opacity: 1;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
@keyframes slide-top {
|
|
409
|
+
0% {
|
|
410
|
+
transform: translateY(-100%);
|
|
411
|
+
opacity: 0;
|
|
412
|
+
}
|
|
413
|
+
100% {
|
|
414
|
+
transform: translateY(0);
|
|
415
|
+
opacity: 1;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
@keyframes slide-top {
|
|
420
|
+
0% {
|
|
421
|
+
transform: translateY(-100%);
|
|
422
|
+
opacity: 0;
|
|
423
|
+
}
|
|
424
|
+
100% {
|
|
425
|
+
transform: translateY(0);
|
|
426
|
+
opacity: 1;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
@keyframes overlay-transition {
|
|
431
|
+
0% {
|
|
432
|
+
opacity: 0;
|
|
433
|
+
}
|
|
434
|
+
100% {
|
|
435
|
+
opacity: var(--overlay-opacity);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
</style>
|
|
@@ -11,6 +11,13 @@ 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 intermediateState = useState('id-intermediate-state', () => ({
|
|
15
|
+
email: '',
|
|
16
|
+
password: '',
|
|
17
|
+
otp: '',
|
|
18
|
+
token: '',
|
|
19
|
+
}))
|
|
20
|
+
|
|
14
21
|
return {
|
|
15
22
|
loginModal,
|
|
16
23
|
twoFactorModal,
|
|
@@ -21,5 +28,6 @@ export function useIdModals() {
|
|
|
21
28
|
newPasswordModal,
|
|
22
29
|
passwordSuccessfulModal,
|
|
23
30
|
confirmSuccessfulModal,
|
|
31
|
+
intermediateState,
|
|
24
32
|
}
|
|
25
33
|
}
|