adata-ui 3.1.73 → 3.1.74
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/runtime/components/CurveBlock.vue +12 -1
- package/dist/runtime/components/PkMobileServices.vue +4 -1
- package/dist/runtime/components/forms/request-demo/RequestDemo.vue +7 -2
- package/dist/runtime/components/forms/request-demo/RequestDemo.vue.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { NuxtLinkLocale } from "#components";
|
|
3
|
+
import { computed, onMounted, ref, useRoute } from "#imports";
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
icon: { type: Object, required: true },
|
|
5
6
|
title: { type: String, required: true },
|
|
@@ -7,6 +8,16 @@ const props = defineProps({
|
|
|
7
8
|
to: { type: String, required: false },
|
|
8
9
|
wide: { type: Boolean, required: false }
|
|
9
10
|
});
|
|
11
|
+
const hostname = ref("");
|
|
12
|
+
const route = useRoute();
|
|
13
|
+
onMounted(() => {
|
|
14
|
+
hostname.value = window.location.hostname;
|
|
15
|
+
});
|
|
16
|
+
const isActive = computed(() => {
|
|
17
|
+
if (!props.to) return false;
|
|
18
|
+
const url = new URL(props.to);
|
|
19
|
+
return url.hostname === hostname.value && url.pathname === route.path;
|
|
20
|
+
});
|
|
10
21
|
</script>
|
|
11
22
|
|
|
12
23
|
<template>
|
|
@@ -14,7 +25,7 @@ const props = defineProps({
|
|
|
14
25
|
:is="to ? NuxtLinkLocale : 'button'"
|
|
15
26
|
:to="to"
|
|
16
27
|
class="curve-block relative w-full cursor-pointer"
|
|
17
|
-
|
|
28
|
+
:class="{ 'active-item': isActive }"
|
|
18
29
|
>
|
|
19
30
|
<svg
|
|
20
31
|
v-if="wide"
|
|
@@ -20,7 +20,10 @@ onMounted(() => {
|
|
|
20
20
|
});
|
|
21
21
|
const isActive = (to) => {
|
|
22
22
|
const url = new URL(to);
|
|
23
|
-
|
|
23
|
+
const currentLocalePath = route.path.split("/")[1];
|
|
24
|
+
const currentPath = route.path.replace(`/${currentLocalePath}`, "") || "/";
|
|
25
|
+
const urlPath = url.pathname.replace(`/${currentLocalePath}`, "") || "/";
|
|
26
|
+
return url.hostname === hostname.value && urlPath === currentPath;
|
|
24
27
|
};
|
|
25
28
|
</script>
|
|
26
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { ref, useI18n
|
|
3
|
+
import { reactive, ref, useI18n } from "#imports";
|
|
4
4
|
import useUIValidation from "../../../composables/useUIValidation";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
title: { type: String, required: false },
|
|
@@ -19,6 +19,10 @@ const schema = z.object({
|
|
|
19
19
|
email: z.string().nonempty(t("forms.feedback.fieldRequired")).email(t("forms.feedback.emailValid")),
|
|
20
20
|
phone_number: z.string().nonempty(t("forms.feedback.fieldRequired")).min(10, t("forms.feedback.phoneMinLength", { count: 10 }))
|
|
21
21
|
});
|
|
22
|
+
function filterPhoneInput(event) {
|
|
23
|
+
const input = event.target;
|
|
24
|
+
form.phone_number = input.value.replace(/[^\d+\-\s()]/g, "");
|
|
25
|
+
}
|
|
22
26
|
const { validation, getError } = useUIValidation(schema, () => form, submitted);
|
|
23
27
|
function onSend() {
|
|
24
28
|
submitted.value = true;
|
|
@@ -71,7 +75,8 @@ function onSend() {
|
|
|
71
75
|
:label="t('forms.demo.p')"
|
|
72
76
|
color-classes="bg-gray-50 dark:bg-gray-800"
|
|
73
77
|
:error="getError('phone_number')"
|
|
74
|
-
type="
|
|
78
|
+
type="tel"
|
|
79
|
+
@input="filterPhoneInput"
|
|
75
80
|
/>
|
|
76
81
|
</div>
|
|
77
82
|
</slot>
|
|
@@ -2,7 +2,7 @@ type __VLS_Props = {
|
|
|
2
2
|
title?: string;
|
|
3
3
|
description?: string;
|
|
4
4
|
};
|
|
5
|
-
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {},
|
|
5
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_31: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
title?: (props: typeof __VLS_1) => any;
|
|
8
8
|
} & {
|
|
@@ -10,7 +10,7 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
} & {
|
|
11
11
|
inputs?: (props: typeof __VLS_5) => any;
|
|
12
12
|
} & {
|
|
13
|
-
info?: (props: typeof
|
|
13
|
+
info?: (props: typeof __VLS_31) => any;
|
|
14
14
|
};
|
|
15
15
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|