adata-ui 3.1.36 → 3.1.38
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/dist/module.json +1 -1
- package/dist/module.mjs +11 -1
- package/dist/runtime/components/Header.vue +8 -2
- package/dist/runtime/components/Modal.vue +286 -0
- package/dist/runtime/components/Modal.vue.d.ts +41 -0
- package/dist/runtime/components/header/ListItem.vue.d.ts +1 -1
- package/dist/runtime/components/mobile-navigation/BottomNavigation.vue +8 -2
- package/dist/runtime/components/modals/NoAccessContent.vue +8 -2
- package/dist/runtime/components/modals/id/IdAccessModal.vue +75 -0
- package/dist/runtime/components/modals/id/IdAccessModal.vue.d.ts +6 -0
- package/dist/runtime/components/modals/id/IdBanner.vue +45 -0
- package/dist/runtime/components/modals/id/IdBanner.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdConfirmAccountOtpModal.vue +169 -0
- package/dist/runtime/components/modals/id/IdConfirmAccountOtpModal.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdConfirmSuccessfulModal.vue +38 -0
- package/dist/runtime/components/modals/id/IdConfirmSuccessfulModal.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdLoginModal.vue +277 -0
- package/dist/runtime/components/modals/id/IdLoginModal.vue.d.ts +6 -0
- package/dist/runtime/components/modals/id/IdModals.vue +98 -0
- package/dist/runtime/components/modals/id/IdModals.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdNewPasswordModal.vue +113 -0
- package/dist/runtime/components/modals/id/IdNewPasswordModal.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdOtpInput.vue +128 -0
- package/dist/runtime/components/modals/id/IdOtpInput.vue.d.ts +15 -0
- package/dist/runtime/components/modals/id/IdPasswordSuccessfulModal.vue +23 -0
- package/dist/runtime/components/modals/id/IdPasswordSuccessfulModal.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdRecoveryModal.vue +103 -0
- package/dist/runtime/components/modals/id/IdRecoveryModal.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdRegistrationModal.vue +177 -0
- package/dist/runtime/components/modals/id/IdRegistrationModal.vue.d.ts +7 -0
- package/dist/runtime/components/modals/id/IdResetPasswordOtpModal.vue +141 -0
- package/dist/runtime/components/modals/id/IdResetPasswordOtpModal.vue.d.ts +2 -0
- package/dist/runtime/components/modals/id/IdTwoFactorModal.vue +114 -0
- package/dist/runtime/components/modals/id/IdTwoFactorModal.vue.d.ts +2 -0
- package/dist/runtime/components/tree-select/components/tree-select-nodes.vue.d.ts +1 -1
- package/dist/runtime/composables/projectState.d.ts +2 -2
- package/dist/runtime/composables/useIdModals.d.ts +23 -0
- package/dist/runtime/composables/useIdModals.js +32 -0
- package/dist/runtime/i18n/i18n.config.d.ts +333 -0
- package/dist/runtime/i18n.d.ts +1 -1
- package/dist/runtime/icons/hand-with-phone/hand-with-phone-dark.vue +52 -0
- package/dist/runtime/icons/hand-with-phone/hand-with-phone-dark.vue.d.ts +2 -0
- package/dist/runtime/icons/hand-with-phone/hand-with-phone-light.vue +52 -0
- package/dist/runtime/icons/hand-with-phone/hand-with-phone-light.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/google.vue +41 -0
- package/dist/runtime/icons/socials/google.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/mailru.vue +34 -0
- package/dist/runtime/icons/socials/mailru.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/yandex.vue +28 -0
- package/dist/runtime/icons/socials/yandex.vue.d.ts +2 -0
- package/dist/runtime/icons/toasts/check-circle-toast.vue +6 -0
- package/dist/runtime/icons/toasts/check-circle-toast.vue.d.ts +2 -0
- package/dist/runtime/icons/toasts/warning-triangle-toast.vue +7 -0
- package/dist/runtime/icons/toasts/warning-triangle-toast.vue.d.ts +2 -0
- package/dist/runtime/illustrations/address-location.vue +38 -0
- package/dist/runtime/illustrations/address-location.vue.d.ts +2 -0
- package/dist/runtime/illustrations/ball-with-chain.vue +120 -0
- package/dist/runtime/illustrations/ball-with-chain.vue.d.ts +2 -0
- package/dist/runtime/illustrations/bill.vue +133 -0
- package/dist/runtime/illustrations/bill.vue.d.ts +2 -0
- package/dist/runtime/illustrations/buildings.vue +82 -0
- package/dist/runtime/illustrations/buildings.vue.d.ts +2 -0
- package/dist/runtime/illustrations/calendar.vue +156 -0
- package/dist/runtime/illustrations/calendar.vue.d.ts +2 -0
- package/dist/runtime/illustrations/chains.vue +152 -0
- package/dist/runtime/illustrations/chains.vue.d.ts +2 -0
- package/dist/runtime/illustrations/coin-percent.vue +126 -0
- package/dist/runtime/illustrations/coin-percent.vue.d.ts +2 -0
- package/dist/runtime/illustrations/coins-stack.vue +202 -0
- package/dist/runtime/illustrations/coins-stack.vue.d.ts +2 -0
- package/dist/runtime/illustrations/delete-dark.vue +31 -0
- package/dist/runtime/illustrations/delete-dark.vue.d.ts +2 -0
- package/dist/runtime/illustrations/delete.vue +32 -0
- package/dist/runtime/illustrations/delete.vue.d.ts +2 -0
- package/dist/runtime/illustrations/doc-with-stamp.vue +126 -0
- package/dist/runtime/illustrations/doc-with-stamp.vue.d.ts +2 -0
- package/dist/runtime/illustrations/document.vue +64 -0
- package/dist/runtime/illustrations/document.vue.d.ts +2 -0
- package/dist/runtime/illustrations/door.vue +74 -0
- package/dist/runtime/illustrations/door.vue.d.ts +2 -0
- package/dist/runtime/illustrations/empty-box.vue +77 -0
- package/dist/runtime/illustrations/empty-box.vue.d.ts +2 -0
- package/dist/runtime/illustrations/empty-wallet.vue +161 -0
- package/dist/runtime/illustrations/empty-wallet.vue.d.ts +2 -0
- package/dist/runtime/illustrations/graph-in-coin.vue +119 -0
- package/dist/runtime/illustrations/graph-in-coin.vue.d.ts +2 -0
- package/dist/runtime/illustrations/hammer.vue +156 -0
- package/dist/runtime/illustrations/hammer.vue.d.ts +2 -0
- package/dist/runtime/illustrations/hand-cash.vue +108 -0
- package/dist/runtime/illustrations/hand-cash.vue.d.ts +2 -0
- package/dist/runtime/illustrations/info.vue +39 -0
- package/dist/runtime/illustrations/info.vue.d.ts +2 -0
- package/dist/runtime/illustrations/mail.vue +68 -0
- package/dist/runtime/illustrations/mail.vue.d.ts +2 -0
- package/dist/runtime/illustrations/ok.vue +62 -0
- package/dist/runtime/illustrations/ok.vue.d.ts +2 -0
- package/dist/runtime/illustrations/people-group.vue +237 -0
- package/dist/runtime/illustrations/people-group.vue.d.ts +2 -0
- package/dist/runtime/illustrations/person-with-phone.vue +187 -0
- package/dist/runtime/illustrations/person-with-phone.vue.d.ts +2 -0
- package/dist/runtime/illustrations/person.vue +159 -0
- package/dist/runtime/illustrations/person.vue.d.ts +2 -0
- package/dist/runtime/illustrations/phone-check.vue +90 -0
- package/dist/runtime/illustrations/phone-check.vue.d.ts +2 -0
- package/dist/runtime/illustrations/phone-payment-method.vue +223 -0
- package/dist/runtime/illustrations/phone-payment-method.vue.d.ts +2 -0
- package/dist/runtime/illustrations/stop-hand.vue +77 -0
- package/dist/runtime/illustrations/stop-hand.vue.d.ts +2 -0
- package/dist/runtime/illustrations/stop-sign.vue +34 -0
- package/dist/runtime/illustrations/stop-sign.vue.d.ts +2 -0
- package/dist/runtime/illustrations/suit.vue +111 -0
- package/dist/runtime/illustrations/suit.vue.d.ts +2 -0
- package/dist/runtime/illustrations/suitcase.vue +105 -0
- package/dist/runtime/illustrations/suitcase.vue.d.ts +2 -0
- package/dist/runtime/illustrations/terminal-dark.vue +48 -0
- package/dist/runtime/illustrations/terminal-dark.vue.d.ts +2 -0
- package/dist/runtime/illustrations/terminal.vue +234 -0
- package/dist/runtime/illustrations/terminal.vue.d.ts +2 -0
- package/dist/runtime/illustrations/trash-can.vue +108 -0
- package/dist/runtime/illustrations/trash-can.vue.d.ts +2 -0
- package/dist/runtime/illustrations/turn-on-tariff.vue +38 -0
- package/dist/runtime/illustrations/turn-on-tariff.vue.d.ts +2 -0
- package/dist/runtime/illustrations/two-persons.vue +169 -0
- package/dist/runtime/illustrations/two-persons.vue.d.ts +2 -0
- package/dist/runtime/lang/en.js +113 -2
- package/dist/runtime/lang/kk.js +113 -2
- package/dist/runtime/lang/ru.d.ts +111 -0
- package/dist/runtime/lang/ru.js +113 -2
- package/dist/runtime/plugins/toast.d.ts +505 -0
- package/dist/runtime/plugins/toast.js +58 -0
- package/dist/runtime/utils/localizedNavigation.d.ts +1 -1
- package/dist/runtime/utils/removeTrailingSlash.d.ts +1 -0
- package/dist/runtime/utils/removeTrailingSlash.js +6 -0
- package/dist/runtime/utils/useUrls.d.ts +15 -0
- package/dist/runtime/utils/useUrls.js +20 -0
- package/package.json +5 -2
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
|
-
import { defineNuxtModule, createResolver, addVitePlugin, addComponentsDir,
|
|
2
|
+
import { defineNuxtModule, createResolver, addVitePlugin, addComponentsDir, addPlugin, installModule, hasNuxtModule } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const module = defineNuxtModule({
|
|
5
5
|
meta: {
|
|
@@ -49,6 +49,16 @@ const module = defineNuxtModule({
|
|
|
49
49
|
path: resolver.resolve("./runtime/icons"),
|
|
50
50
|
prefix: "I"
|
|
51
51
|
});
|
|
52
|
+
_nuxt.options.alias["#adata-ui"] = resolver.resolve("./runtime");
|
|
53
|
+
_nuxt.options.alias["#illustrations"] = resolver.resolve("./runtime/illustrations");
|
|
54
|
+
addComponentsDir({
|
|
55
|
+
path: resolver.resolve("./runtime/illustrations"),
|
|
56
|
+
prefix: "Ill"
|
|
57
|
+
});
|
|
58
|
+
addPlugin({
|
|
59
|
+
src: resolver.resolve("./runtime/plugins/toast.ts"),
|
|
60
|
+
mode: "client"
|
|
61
|
+
});
|
|
52
62
|
await installModule("@nuxtjs/i18n", {
|
|
53
63
|
defaultLocale: "ru",
|
|
54
64
|
strategy: "prefix_except_default"
|
|
@@ -8,6 +8,7 @@ import { useI18n, ref, onBeforeMount, useAppConfig, useRuntimeConfig } from "#im
|
|
|
8
8
|
import ILogout from "#icons/navigation/logout.vue";
|
|
9
9
|
import IAdata from "#icons/logo/adata.vue";
|
|
10
10
|
import LangSwitcher from "./header/LangSwitcher.vue";
|
|
11
|
+
import { useIdModals } from "#adata-ui/composables/useIdModals";
|
|
11
12
|
const { localize, isColorModeActive } = useRuntimeConfig().public.adataUI;
|
|
12
13
|
const props = defineProps({
|
|
13
14
|
replenish: { type: String, required: false },
|
|
@@ -26,11 +27,16 @@ const props = defineProps({
|
|
|
26
27
|
});
|
|
27
28
|
const emit = defineEmits(["logout", "search", "login"]);
|
|
28
29
|
const { t } = useI18n();
|
|
29
|
-
const
|
|
30
|
-
const mode =
|
|
30
|
+
const { adataUI } = useAppConfig();
|
|
31
|
+
const { mode, authMode } = adataUI;
|
|
32
|
+
const { loginModal } = useIdModals();
|
|
31
33
|
const langIsOn = false;
|
|
32
34
|
const contacts = ref(useContacts());
|
|
33
35
|
const goAuth = () => {
|
|
36
|
+
if (authMode === "local") {
|
|
37
|
+
loginModal.value = true;
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
34
40
|
if (window) {
|
|
35
41
|
emit("login");
|
|
36
42
|
let fullPath = props.redirectAfterLogin ?? encodeURIComponent(window.location.toString());
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { watch, ref, computed, useSlots, onBeforeMount, nextTick } from "#imports";
|
|
3
|
+
import { twJoin, twMerge } from "tailwind-merge";
|
|
4
|
+
import { onClickOutside, useWindowSize } from "@vueuse/core";
|
|
5
|
+
import { disableBodyScroll, enableBodyScroll } from "body-scroll-lock";
|
|
6
|
+
const uiConfig = {
|
|
7
|
+
wrapper: "modal-wrapper relative z-[10001]",
|
|
8
|
+
overlay: {
|
|
9
|
+
base: "fixed inset-0 transition-opacity ",
|
|
10
|
+
background: "bg-deepblue-900/20 dark:bg-white/20 backdrop-blur",
|
|
11
|
+
transition: {
|
|
12
|
+
"enter-active-class": "ease-out duration-300",
|
|
13
|
+
"enter-from-class": "opacity-0",
|
|
14
|
+
"enter-to-class": "opacity-100",
|
|
15
|
+
"leave-active-class": "ease-in duration-200",
|
|
16
|
+
"leave-from-class": "opacity-100",
|
|
17
|
+
"leave-to-class": "opacity-0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
base: "base-modal max-h-full fixed text-deepblue-900 dark:text-gray-200 text-left rtl:text-right flex flex-col max-w-full sm:max-h-[calc(100%-48px)]",
|
|
21
|
+
position: "top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2",
|
|
22
|
+
padding: "p-8",
|
|
23
|
+
background: "bg-white dark:bg-gray-900",
|
|
24
|
+
rounded: "rounded-lg",
|
|
25
|
+
fullscreen: "w-screen h-screen rounded-none",
|
|
26
|
+
mobile: {
|
|
27
|
+
width: "w-screen",
|
|
28
|
+
position: "bottom-0 left-0 transition-transform",
|
|
29
|
+
padding: "px-4 sm:pb-8 pb-4 pt-3",
|
|
30
|
+
rounded: "rounded-t-2xl"
|
|
31
|
+
},
|
|
32
|
+
transition: {
|
|
33
|
+
desktop: {
|
|
34
|
+
"enter-active-class": "ease-out duration-300",
|
|
35
|
+
"enter-from-class": "opacity-0 bg",
|
|
36
|
+
"enter-to-class": "opacity-100",
|
|
37
|
+
"leave-active-class": "ease-in duration-200",
|
|
38
|
+
"leave-from-class": "opacity-100",
|
|
39
|
+
"leave-to-class": "opacity-0"
|
|
40
|
+
},
|
|
41
|
+
mobile: {
|
|
42
|
+
"enter-active-class": "transition-transform ease-in-out duration-300",
|
|
43
|
+
"leave-active-class": "transition-transform ease-in-out duration-200",
|
|
44
|
+
"enter-from-class": "translate-y-[100%]",
|
|
45
|
+
"leave-to-class": "translate-y-[100%]"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const props = defineProps({
|
|
50
|
+
title: { type: String, required: false, default: "" },
|
|
51
|
+
transition: { type: Boolean, required: false, default: true },
|
|
52
|
+
overlay: { type: Boolean, required: false, default: true },
|
|
53
|
+
preventClose: { type: Boolean, required: false, default: false },
|
|
54
|
+
fullscreen: { type: Boolean, required: false, default: false },
|
|
55
|
+
name: { type: String, required: false, default: "modal" },
|
|
56
|
+
isScrollable: { type: Boolean, required: false, default: false },
|
|
57
|
+
width: { type: [String, Number], required: false, default: 424 },
|
|
58
|
+
heightModalClass: { type: String, required: false, default: "" }
|
|
59
|
+
});
|
|
60
|
+
const content = ref();
|
|
61
|
+
const emit = defineEmits(["close"]);
|
|
62
|
+
const slots = useSlots();
|
|
63
|
+
const { width: windowWidth } = useWindowSize();
|
|
64
|
+
const modelValue = defineModel({ type: Boolean });
|
|
65
|
+
let teleportContainer;
|
|
66
|
+
const modal = ref(null);
|
|
67
|
+
const isMobile = computed(() => windowWidth.value < 1025);
|
|
68
|
+
const wrapperClasses = uiConfig.wrapper;
|
|
69
|
+
const overlayClasses = computed(() => !props.overlay || twMerge(twJoin(uiConfig.overlay.base, uiConfig.overlay.background)));
|
|
70
|
+
const baseClasses = computed(() => twMerge(twJoin(
|
|
71
|
+
uiConfig.base,
|
|
72
|
+
uiConfig.background,
|
|
73
|
+
props.heightModalClass,
|
|
74
|
+
props.fullscreen ? uiConfig.fullscreen : "",
|
|
75
|
+
isMobile.value ? uiConfig.mobile.padding : uiConfig.padding,
|
|
76
|
+
isMobile.value ? uiConfig.mobile.rounded : uiConfig.rounded,
|
|
77
|
+
isMobile.value ? uiConfig.mobile.width : "",
|
|
78
|
+
isMobile.value ? uiConfig.mobile.position : uiConfig.position
|
|
79
|
+
)));
|
|
80
|
+
const transitionClasses = computed(() => {
|
|
81
|
+
return {
|
|
82
|
+
overlay: props.transition ? uiConfig.overlay.transition : {},
|
|
83
|
+
base: props.transition ? !isMobile.value ? uiConfig.transition.desktop : uiConfig.transition.mobile : {}
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
const modalStyles = computed(() => {
|
|
87
|
+
if (props.fullscreen || isMobile.value) return;
|
|
88
|
+
return ` width: ${props.width}${typeof props.width === "number" ? "px" : ""}`;
|
|
89
|
+
});
|
|
90
|
+
const onClose = () => {
|
|
91
|
+
modelValue.value = false;
|
|
92
|
+
emit("close");
|
|
93
|
+
};
|
|
94
|
+
onClickOutside(modal, () => props.preventClose || onClose());
|
|
95
|
+
const hasSlot = (name) => {
|
|
96
|
+
return Boolean(slots[name]);
|
|
97
|
+
};
|
|
98
|
+
const hasFooter = computed(() => {
|
|
99
|
+
return hasSlot("footer");
|
|
100
|
+
});
|
|
101
|
+
const hasHeader = computed(() => {
|
|
102
|
+
return props.title || hasSlot("header");
|
|
103
|
+
});
|
|
104
|
+
const hasContent = computed(() => {
|
|
105
|
+
return Boolean(slots.default);
|
|
106
|
+
});
|
|
107
|
+
onBeforeMount(() => {
|
|
108
|
+
const alreadyCreatedTarget = document.getElementById(props.name);
|
|
109
|
+
if (alreadyCreatedTarget) return;
|
|
110
|
+
teleportContainer = document.createElement("div");
|
|
111
|
+
teleportContainer.setAttribute("id", props.name);
|
|
112
|
+
document.body.appendChild(teleportContainer);
|
|
113
|
+
});
|
|
114
|
+
const positionStart = ref(0);
|
|
115
|
+
const isClose = ref(false);
|
|
116
|
+
const modalHeight = ref(0);
|
|
117
|
+
const touchstart = (event) => {
|
|
118
|
+
isClose.value = false;
|
|
119
|
+
positionStart.value = event.touches[0].clientY;
|
|
120
|
+
modalHeight.value = modal.value?.offsetHeight || 0;
|
|
121
|
+
};
|
|
122
|
+
const touchmove = (event) => {
|
|
123
|
+
if (!isMobile.value) return;
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
const touchPosition = event.touches[0].clientY;
|
|
126
|
+
const step = touchPosition - positionStart.value;
|
|
127
|
+
if (step < 0) return;
|
|
128
|
+
const newHeight = modalHeight.value - step;
|
|
129
|
+
modal.value.style.height = `${newHeight}px`;
|
|
130
|
+
isClose.value = step > 65;
|
|
131
|
+
};
|
|
132
|
+
const touchend = () => {
|
|
133
|
+
if (isClose.value) {
|
|
134
|
+
onClose();
|
|
135
|
+
} else {
|
|
136
|
+
modal.value.style.height = `${modalHeight.value}px`;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const toggleBodyScroll = (lock) => {
|
|
140
|
+
if (!content.value) return;
|
|
141
|
+
if (lock) {
|
|
142
|
+
setTimeout(() => {
|
|
143
|
+
disableBodyScroll(content.value, {
|
|
144
|
+
reserveScrollBarGap: true,
|
|
145
|
+
allowTouchMove: (el) => {
|
|
146
|
+
return el && modal.value?.contains(el);
|
|
147
|
+
}
|
|
148
|
+
// allowTouchMove: (el: EventTarget | null): boolean => {
|
|
149
|
+
// if (!el || !content.value) return false;
|
|
150
|
+
//
|
|
151
|
+
// // Функция проверки, есть ли у элемента вертикальный скролл
|
|
152
|
+
// const hasScroll = (el: HTMLElement | null): boolean => {
|
|
153
|
+
// if (!el) return false;
|
|
154
|
+
// return el.scrollHeight > el.clientHeight;
|
|
155
|
+
// };
|
|
156
|
+
//
|
|
157
|
+
// // Функция поиска блока с position: absolute
|
|
158
|
+
// const findAbsoluteBlock = (el: HTMLElement | null): HTMLElement | null => {
|
|
159
|
+
// while (el && el !== content.value) {
|
|
160
|
+
// const style = window.getComputedStyle(el);
|
|
161
|
+
// if (style.position === 'absolute') return el; // Возвращаем найденный absolute-элемент
|
|
162
|
+
// el = el.parentElement;
|
|
163
|
+
// }
|
|
164
|
+
// return null;
|
|
165
|
+
// };
|
|
166
|
+
//
|
|
167
|
+
// // Проверяем, есть ли у родителя absolute-позиционирование
|
|
168
|
+
// const someParentHasScroll = (el: HTMLElement | null, maxParentEl: HTMLElement | null): boolean => {
|
|
169
|
+
// while (el && maxParentEl && el !== maxParentEl) {
|
|
170
|
+
// if (hasScroll(el)){
|
|
171
|
+
// return true
|
|
172
|
+
// } // Если нашли родителя со скроллом, возвращаем true
|
|
173
|
+
// el = el?.parentElement;
|
|
174
|
+
// }
|
|
175
|
+
// return false; // Если не нашли, возвращаем false
|
|
176
|
+
// };
|
|
177
|
+
//
|
|
178
|
+
// const absoluteBlock = findAbsoluteBlock(el as HTMLElement);
|
|
179
|
+
//
|
|
180
|
+
//
|
|
181
|
+
// // Проверяем наличие скролла у основного контента
|
|
182
|
+
// const contentHasScroll = hasScroll(content.value);
|
|
183
|
+
//
|
|
184
|
+
// // Проверка на то, что элемент находится внутри модального контента
|
|
185
|
+
// const isInsideModal = content.value.contains(el as Node);
|
|
186
|
+
//
|
|
187
|
+
//
|
|
188
|
+
// return (contentHasScroll && isInsideModal) || (isInsideModal && absoluteBlock && someParentHasScroll(el, absoluteBlock));
|
|
189
|
+
// }
|
|
190
|
+
//
|
|
191
|
+
});
|
|
192
|
+
}, 0);
|
|
193
|
+
} else {
|
|
194
|
+
enableBodyScroll(content.value);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
watch(modelValue, async (newValue) => {
|
|
198
|
+
if (newValue) {
|
|
199
|
+
await nextTick();
|
|
200
|
+
toggleBodyScroll(true);
|
|
201
|
+
} else {
|
|
202
|
+
toggleBodyScroll(false);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
</script>
|
|
206
|
+
|
|
207
|
+
<template>
|
|
208
|
+
<client-only>
|
|
209
|
+
<teleport :to="`#${name}`">
|
|
210
|
+
<div
|
|
211
|
+
:class="wrapperClasses"
|
|
212
|
+
>
|
|
213
|
+
<Transition
|
|
214
|
+
name="overlay"
|
|
215
|
+
v-bind="transitionClasses.overlay"
|
|
216
|
+
>
|
|
217
|
+
<div
|
|
218
|
+
v-show="modelValue"
|
|
219
|
+
ref="overlay"
|
|
220
|
+
:class="overlayClasses"
|
|
221
|
+
/>
|
|
222
|
+
</Transition>
|
|
223
|
+
<Transition
|
|
224
|
+
name="modal"
|
|
225
|
+
v-bind="transitionClasses.base"
|
|
226
|
+
>
|
|
227
|
+
<div
|
|
228
|
+
v-if="modelValue"
|
|
229
|
+
class="fixed overflow-y-auto inset-0"
|
|
230
|
+
>
|
|
231
|
+
<div
|
|
232
|
+
ref="modal"
|
|
233
|
+
:class="baseClasses"
|
|
234
|
+
:style="modalStyles"
|
|
235
|
+
>
|
|
236
|
+
<div
|
|
237
|
+
v-if="isMobile"
|
|
238
|
+
class="w-full flex justify-center items-center -mt-3 pt-3 mb-2"
|
|
239
|
+
@touchmove="touchmove"
|
|
240
|
+
@touchstart="touchstart"
|
|
241
|
+
@touchend="touchend"
|
|
242
|
+
>
|
|
243
|
+
<div class="h-1 w-10 bg-[#D9D9D9] rounded m-1" />
|
|
244
|
+
</div>
|
|
245
|
+
<div
|
|
246
|
+
class="flex flex-col gap-5"
|
|
247
|
+
:class="isScrollable ? 'overflow-x-hidden' : ''"
|
|
248
|
+
>
|
|
249
|
+
<div
|
|
250
|
+
v-if="hasHeader"
|
|
251
|
+
class="top"
|
|
252
|
+
>
|
|
253
|
+
<h4
|
|
254
|
+
v-if="title"
|
|
255
|
+
class="heading-02 text-center"
|
|
256
|
+
@touchmove="touchmove"
|
|
257
|
+
@touchstart="touchstart"
|
|
258
|
+
@touchend="touchend"
|
|
259
|
+
>
|
|
260
|
+
{{ title }}
|
|
261
|
+
</h4>
|
|
262
|
+
<div v-if="!!$slots.header">
|
|
263
|
+
<slot name="header" />
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
<div
|
|
267
|
+
v-if="hasContent"
|
|
268
|
+
ref="content"
|
|
269
|
+
class="grow"
|
|
270
|
+
:class="isScrollable ? 'overflow-x-hidden' : ''"
|
|
271
|
+
>
|
|
272
|
+
<slot />
|
|
273
|
+
</div>
|
|
274
|
+
<div
|
|
275
|
+
v-if="hasFooter"
|
|
276
|
+
>
|
|
277
|
+
<slot name="footer" />
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
</Transition>
|
|
283
|
+
</div>
|
|
284
|
+
</teleport>
|
|
285
|
+
</client-only>
|
|
286
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
transition?: boolean;
|
|
4
|
+
overlay?: boolean;
|
|
5
|
+
preventClose?: boolean;
|
|
6
|
+
fullscreen?: boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
isScrollable?: boolean;
|
|
9
|
+
width?: string | number;
|
|
10
|
+
heightModalClass?: string;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = Props;
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
14
|
+
modelValue?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare var __VLS_18: {}, __VLS_20: {}, __VLS_22: {};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
header?: (props: typeof __VLS_18) => any;
|
|
19
|
+
} & {
|
|
20
|
+
default?: (props: typeof __VLS_20) => any;
|
|
21
|
+
} & {
|
|
22
|
+
footer?: (props: typeof __VLS_22) => any;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
|
|
25
|
+
name: string;
|
|
26
|
+
transition: boolean;
|
|
27
|
+
title: string;
|
|
28
|
+
overlay: boolean;
|
|
29
|
+
preventClose: boolean;
|
|
30
|
+
fullscreen: boolean;
|
|
31
|
+
isScrollable: boolean;
|
|
32
|
+
width: string | number;
|
|
33
|
+
heightModalClass: string;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useAppConfig, useI18n } from "#imports";
|
|
3
|
+
import { useIdModals } from "#adata-ui/composables/useIdModals";
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
items: { type: Array, required: true },
|
|
5
6
|
hasNotification: { type: Boolean, required: false },
|
|
6
7
|
isAuthenticated: { type: Boolean, required: true }
|
|
7
8
|
});
|
|
8
9
|
const activeModel = defineModel({ type: String, ...{ default: "" } });
|
|
9
|
-
const
|
|
10
|
-
const mode =
|
|
10
|
+
const { adataUI } = useAppConfig();
|
|
11
|
+
const { mode, authMode } = adataUI;
|
|
12
|
+
const { loginModal } = useIdModals();
|
|
11
13
|
const { t } = useI18n();
|
|
12
14
|
function pushItem(value) {
|
|
13
15
|
if (value === activeModel.value) value = "";
|
|
@@ -17,6 +19,10 @@ function pushProfile() {
|
|
|
17
19
|
if (props.isAuthenticated) {
|
|
18
20
|
pushItem("profile");
|
|
19
21
|
} else {
|
|
22
|
+
if (authMode === "local") {
|
|
23
|
+
loginModal.value = true;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
20
26
|
const fullPath = encodeURIComponent(window.location.toString());
|
|
21
27
|
location.href = `https://id.${mode}.kz/?url=${fullPath}`;
|
|
22
28
|
}
|
|
@@ -3,15 +3,21 @@ import AButton from "../button/Button.vue";
|
|
|
3
3
|
import { useAppConfig, useI18n } from "#imports";
|
|
4
4
|
import { navigateTo } from "#app";
|
|
5
5
|
import { useLocalePath } from "#i18n";
|
|
6
|
+
import { useIdModals } from "#adata-ui/composables/useIdModals";
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
redirectPath: { type: String, required: true }
|
|
8
9
|
});
|
|
9
10
|
const emit = defineEmits(["close"]);
|
|
10
11
|
const { t } = useI18n();
|
|
11
|
-
const
|
|
12
|
-
const mode =
|
|
12
|
+
const { adataUI } = useAppConfig();
|
|
13
|
+
const { mode, authMode } = adataUI;
|
|
13
14
|
const localePath = useLocalePath();
|
|
15
|
+
const { loginModal } = useIdModals();
|
|
14
16
|
function logIn() {
|
|
17
|
+
if (authMode === "local") {
|
|
18
|
+
loginModal.value = true;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
15
21
|
const fullPath = encodeURIComponent(window.location.toString());
|
|
16
22
|
return navigateTo(localePath(`https://id.${mode}.kz/?url=${fullPath}${props.redirectPath}`), { external: true });
|
|
17
23
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useAppConfig, useI18n } from "#imports";
|
|
3
|
+
import { useIdModals } from "#adata-ui/composables/useIdModals";
|
|
4
|
+
import { useUrls } from "#adata-ui/utils/useUrls";
|
|
5
|
+
const emit = defineEmits(["close"]);
|
|
6
|
+
const { t } = useI18n();
|
|
7
|
+
const { adataUI } = useAppConfig();
|
|
8
|
+
const { login } = useUrls();
|
|
9
|
+
const { accessModal, loginModal, registrationModal } = useIdModals();
|
|
10
|
+
function goAuth() {
|
|
11
|
+
if (adataUI.authMode === "local") {
|
|
12
|
+
accessModal.value = false;
|
|
13
|
+
loginModal.value = true;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (window) {
|
|
17
|
+
let fullPath = encodeURIComponent(window.location.toString());
|
|
18
|
+
if (fullPath.includes("basic-info")) {
|
|
19
|
+
fullPath = fullPath.replace("%2Fcounterparty%2Fmain", "").replace("%2Fbasic-info", "");
|
|
20
|
+
}
|
|
21
|
+
window.location.href = `${login}?url=${fullPath}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function goRegister() {
|
|
25
|
+
if (adataUI.authMode === "local") {
|
|
26
|
+
accessModal.value = false;
|
|
27
|
+
registrationModal.value = true;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (window) {
|
|
31
|
+
let fullPath = encodeURIComponent(window.location.toString());
|
|
32
|
+
if (fullPath.includes("basic-info")) {
|
|
33
|
+
fullPath = fullPath.replace("%2Fcounterparty%2Fmain", "").replace("%2Fbasic-info", "");
|
|
34
|
+
}
|
|
35
|
+
window.location.href = `${login}register?url=${fullPath}`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<adt-modal
|
|
42
|
+
v-model="accessModal"
|
|
43
|
+
:title="t('modals.auth.title')"
|
|
44
|
+
>
|
|
45
|
+
<div class="flex flex-col items-center gap-5 text-center text-sm">
|
|
46
|
+
<ill-door />
|
|
47
|
+
<div>{{ t("modals.auth.content") }}</div>
|
|
48
|
+
<adt-button
|
|
49
|
+
block
|
|
50
|
+
variant="success"
|
|
51
|
+
@click="goAuth"
|
|
52
|
+
>
|
|
53
|
+
{{ t("modals.buttons.logIn") }}
|
|
54
|
+
</adt-button>
|
|
55
|
+
<div>{{ t("modals.auth.firstTime") }}</div>
|
|
56
|
+
</div>
|
|
57
|
+
<template #footer>
|
|
58
|
+
<div class="flex gap-2">
|
|
59
|
+
<adt-button
|
|
60
|
+
view="outline"
|
|
61
|
+
block
|
|
62
|
+
@click="emit('close')"
|
|
63
|
+
>
|
|
64
|
+
{{ t("modals.buttons.close") }}
|
|
65
|
+
</adt-button>
|
|
66
|
+
<adt-button
|
|
67
|
+
block
|
|
68
|
+
@click="goRegister"
|
|
69
|
+
>
|
|
70
|
+
{{ t("modals.buttons.register") }}
|
|
71
|
+
</adt-button>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
</adt-modal>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
close: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onClose?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useI18n } from "#imports";
|
|
3
|
+
import { useIdModals } from "#adata-ui/composables/useIdModals";
|
|
4
|
+
const { t } = useI18n();
|
|
5
|
+
const { registrationModal } = useIdModals();
|
|
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.banners.auth.title") }}
|
|
16
|
+
</p>
|
|
17
|
+
<i18n-t
|
|
18
|
+
keypath="modals.id.banners.auth.subtitle"
|
|
19
|
+
tag="p"
|
|
20
|
+
class="text-sm text-gray-600 dark:text-gray-200"
|
|
21
|
+
>
|
|
22
|
+
<template #register>
|
|
23
|
+
<button
|
|
24
|
+
class="font-semibold text-blue-700 dark:text-blue-500"
|
|
25
|
+
@click="onRegister"
|
|
26
|
+
>
|
|
27
|
+
{{ t("modals.id.banners.auth.register") }}
|
|
28
|
+
</button>
|
|
29
|
+
</template>
|
|
30
|
+
</i18n-t>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<adt-button
|
|
34
|
+
size="md"
|
|
35
|
+
class="self-end"
|
|
36
|
+
@click="onRegister"
|
|
37
|
+
>
|
|
38
|
+
{{ t("actions.register") }}
|
|
39
|
+
</adt-button>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<style scoped>
|
|
44
|
+
.gradient{background:linear-gradient(239.71deg,#b3d5f9 -7.48%,#e6f1fd 39.62%,#cce2fb 85.82%)}.dark .gradient{background:linear-gradient(239.71deg,#17303f -7.48%,#161617 39.62%,#17303f 85.82%)}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|