@unsource/ui 2.2.0 → 2.2.2
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/assets/main.css +130 -0
- package/dist/runtime/assets/transition.css +63 -0
- package/dist/runtime/components/UnAuth.d.vue.ts +3 -1
- package/dist/runtime/components/UnAuth.vue +45 -28
- package/dist/runtime/components/UnAuth.vue.d.ts +3 -1
- package/dist/runtime/components/UnAuthInputs.d.vue.ts +3 -3
- package/dist/runtime/components/UnAuthInputs.vue.d.ts +3 -3
- package/dist/runtime/components/UnAuthShortHand.d.vue.ts +1 -1
- package/dist/runtime/components/UnAuthShortHand.vue +1 -1
- package/dist/runtime/components/UnAuthShortHand.vue.d.ts +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
.fade-enter-active,
|
|
2
|
+
.fade-leave-active {
|
|
3
|
+
transition: opacity 0.3s;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.fade-enter, .fade-leave-to {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.list-enter-active,
|
|
11
|
+
.list-leave-active {
|
|
12
|
+
transition: all 0.3s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.list-enter, .list-leave-to {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transform: translateY(30px);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.side-enter-active,
|
|
21
|
+
.side-leave-active {
|
|
22
|
+
transition: all 0.3s;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.side-enter, .side-leave-to {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transform: translateX(30px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.slide-up-enter-active,
|
|
31
|
+
.slide-up-leave-active {
|
|
32
|
+
transition: all 0.3s;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.slide-up-enter, .slide-up-leave-to {
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transform: translateY(100%);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.border-animation {
|
|
41
|
+
animation-name: border;
|
|
42
|
+
animation-direction: alternate;
|
|
43
|
+
animation-iteration-count: infinite;
|
|
44
|
+
animation-duration: 1s;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes border {
|
|
48
|
+
0% {
|
|
49
|
+
transform: scale(1.2);
|
|
50
|
+
}
|
|
51
|
+
100% {
|
|
52
|
+
transform: scale(0.8);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.page-enter-active,
|
|
56
|
+
.page-leave-active {
|
|
57
|
+
transition: all 0.3s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.page-enter-from,
|
|
61
|
+
.page-leave-to {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:root {
|
|
66
|
+
--toastify-font-family: Yekan Bakh FaNum, sans-serif ;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
body {
|
|
70
|
+
font-family: Yekan Bakh FaNum, sans-serif;
|
|
71
|
+
font-style: normal;
|
|
72
|
+
padding: 0;
|
|
73
|
+
margin: 0;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
scroll-behavior: smooth;
|
|
76
|
+
@apply text-text-head bg-primary-100;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
div {
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
p, h1, h2, h3, h4, h5, h6 {
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
a {
|
|
88
|
+
color: inherit;
|
|
89
|
+
font-family: inherit;
|
|
90
|
+
text-decoration: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
input {
|
|
94
|
+
min-width: 0;
|
|
95
|
+
width: 100%;
|
|
96
|
+
outline-offset: 0 !important;
|
|
97
|
+
outline: none !important;
|
|
98
|
+
font-family: Yekan Bakh FaNum, sans-serif;
|
|
99
|
+
border: none;
|
|
100
|
+
@apply bg-white text-text-head;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
button {
|
|
104
|
+
font-family: inherit;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
textarea {
|
|
108
|
+
font-family: inherit;
|
|
109
|
+
resize: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
input::-webkit-outer-spin-button,
|
|
113
|
+
input::-webkit-inner-spin-button {
|
|
114
|
+
-webkit-appearance: none;
|
|
115
|
+
margin: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
input[type=number] {
|
|
119
|
+
-moz-appearance: textfield;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.vpd-main .vpd-is-inline {
|
|
123
|
+
@apply mt-0;
|
|
124
|
+
}
|
|
125
|
+
.vpd-main .vpd-content {
|
|
126
|
+
@apply "!w-full";
|
|
127
|
+
}
|
|
128
|
+
.vpd-main .vpd-content .vpd-days .vpd-clearfix, .vpd-main .vpd-content .vpd-week.vpd-clearfix {
|
|
129
|
+
@apply flex justify-between;
|
|
130
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.fade-enter-active,
|
|
2
|
+
.fade-leave-active {
|
|
3
|
+
transition: opacity 0.3s;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.fade-enter, .fade-leave-to {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.list-enter-active,
|
|
11
|
+
.list-leave-active {
|
|
12
|
+
transition: all 0.3s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.list-enter, .list-leave-to {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transform: translateY(30px);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.side-enter-active,
|
|
21
|
+
.side-leave-active {
|
|
22
|
+
transition: all 0.3s;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.side-enter, .side-leave-to {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transform: translateX(30px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.slide-up-enter-active,
|
|
31
|
+
.slide-up-leave-active {
|
|
32
|
+
transition: all 0.3s;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.slide-up-enter, .slide-up-leave-to {
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transform: translateY(100%);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.border-animation {
|
|
41
|
+
animation-name: border;
|
|
42
|
+
animation-direction: alternate;
|
|
43
|
+
animation-iteration-count: infinite;
|
|
44
|
+
animation-duration: 1s;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes border {
|
|
48
|
+
0% {
|
|
49
|
+
transform: scale(1.2);
|
|
50
|
+
}
|
|
51
|
+
100% {
|
|
52
|
+
transform: scale(0.8);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.page-enter-active,
|
|
56
|
+
.page-leave-active {
|
|
57
|
+
transition: all 0.3s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.page-enter-from,
|
|
61
|
+
.page-leave-to {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
}
|
|
@@ -11,12 +11,14 @@ type Props = {
|
|
|
11
11
|
profilePage?: string;
|
|
12
12
|
profileFormPage?: string;
|
|
13
13
|
loginPage?: string;
|
|
14
|
+
registerPage?: string;
|
|
14
15
|
passLoginPage?: string;
|
|
16
|
+
privacyLink?: string;
|
|
15
17
|
successLoginAlert?: string;
|
|
16
18
|
title?: string;
|
|
17
19
|
buttonTitle?: string;
|
|
18
20
|
forgetPassword?: boolean;
|
|
19
|
-
click?: Record<string,
|
|
21
|
+
click?: Record<string, unknown>;
|
|
20
22
|
shortHand?: boolean;
|
|
21
23
|
};
|
|
22
24
|
declare var __VLS_29: {};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
<template v-if="['login', 'recover'].includes(type)">
|
|
14
14
|
<UnAuthInputs
|
|
15
|
-
v-model="
|
|
15
|
+
v-model="data"
|
|
16
16
|
:type="type === 'recover' ? type : loginType"
|
|
17
17
|
:head
|
|
18
18
|
:have-tabs="true"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<p class="text-(sm gray-600)">
|
|
28
28
|
با ورود،
|
|
29
29
|
<NuxtLink
|
|
30
|
-
to="
|
|
30
|
+
:to="privacyLink"
|
|
31
31
|
target="_blank"
|
|
32
32
|
class="text-gra-900 font-bold underline"
|
|
33
33
|
>قوانین و
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</p>
|
|
49
49
|
<div
|
|
50
50
|
class="text-xs text-gray-600 underline cursor-pointer"
|
|
51
|
-
@click="navigateTo({ name:
|
|
51
|
+
@click="navigateTo({ name: loginPage })"
|
|
52
52
|
>
|
|
53
53
|
{{ $t("\u062A\u063A\u06CC\u06CC\u0631 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 ") }}
|
|
54
54
|
</div>
|
|
@@ -77,18 +77,18 @@
|
|
|
77
77
|
/>
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
80
|
-
<form>
|
|
81
|
-
<input
|
|
82
|
-
v-model="otp"
|
|
83
|
-
name="one-time-code"
|
|
84
|
-
class="w-0 h-0"
|
|
85
|
-
type="text"
|
|
86
|
-
autocomplete="one-time-code"
|
|
87
|
-
inputmode="numeric"
|
|
88
|
-
autofocus
|
|
89
|
-
pattern="\d{6}"
|
|
90
|
-
>
|
|
91
|
-
</form>
|
|
80
|
+
<!-- <form> -->
|
|
81
|
+
<!-- <input -->
|
|
82
|
+
<!-- v-model="otp" -->
|
|
83
|
+
<!-- name="one-time-code" -->
|
|
84
|
+
<!-- class="w-0 h-0" -->
|
|
85
|
+
<!-- type="text" -->
|
|
86
|
+
<!-- autocomplete="one-time-code" -->
|
|
87
|
+
<!-- inputmode="numeric" -->
|
|
88
|
+
<!-- autofocus -->
|
|
89
|
+
<!-- pattern="\d{6}" -->
|
|
90
|
+
<!-- > -->
|
|
91
|
+
<!-- </form> -->
|
|
92
92
|
</div>
|
|
93
93
|
<slot />
|
|
94
94
|
</div>
|
|
@@ -98,19 +98,19 @@
|
|
|
98
98
|
v-if="forgetPassword"
|
|
99
99
|
:description="$t('\u062D\u0633\u0627\u0628 \u06A9\u0627\u0631\u0628\u0631\u06CC \u0646\u062F\u0627\u0631\u06CC\u062F\u061F ')"
|
|
100
100
|
:text-link="$t('\u062B\u0628\u062A \u0646\u0627\u0645 \u06A9\u0646\u06CC\u062F')"
|
|
101
|
-
link="
|
|
101
|
+
:link="{ name: registerPage }"
|
|
102
102
|
/>
|
|
103
103
|
<UnAuthShortHand
|
|
104
104
|
v-else-if="otp"
|
|
105
105
|
:description="$t('\u0634\u0645\u0627\u0631\u0647 \u062A\u0644\u0641\u0646 \u0627\u0634\u062A\u0628\u0627\u0647 \u0627\u0633\u062A\u061F')"
|
|
106
106
|
:text-link="$t('\u0648\u06CC\u0631\u0627\u06CC\u0634')"
|
|
107
|
-
:link="
|
|
107
|
+
:link="{ name: loginPage, query: route.query }"
|
|
108
108
|
/>
|
|
109
109
|
<UnAuthShortHand
|
|
110
110
|
v-else
|
|
111
111
|
:description="$t('\u062D\u0633\u0627\u0628 \u06A9\u0627\u0631\u0628\u0631\u06CC \u062F\u0627\u0631\u06CC\u062F\u061F ')"
|
|
112
112
|
:text-link="$t('\u0648\u0627\u0631\u062F \u0634\u0648\u06CC\u062F')"
|
|
113
|
-
link="
|
|
113
|
+
:link="{ name: loginPage }"
|
|
114
114
|
/>
|
|
115
115
|
</template>
|
|
116
116
|
<UnButton
|
|
@@ -122,7 +122,10 @@
|
|
|
122
122
|
/>
|
|
123
123
|
</div>
|
|
124
124
|
</div>
|
|
125
|
-
<UnLog
|
|
125
|
+
<UnLog
|
|
126
|
+
:data="data"
|
|
127
|
+
:fixed="false"
|
|
128
|
+
/>
|
|
126
129
|
</template>
|
|
127
130
|
|
|
128
131
|
<script setup>
|
|
@@ -141,7 +144,19 @@ import {
|
|
|
141
144
|
useUser,
|
|
142
145
|
useUserId
|
|
143
146
|
} from "#imports";
|
|
144
|
-
const {
|
|
147
|
+
const {
|
|
148
|
+
successLoginAlert = "\u062E\u0648\u0634 \u0622\u0645\u062F\u06CC\u062F",
|
|
149
|
+
loginPage = "login",
|
|
150
|
+
registerPage = "signup",
|
|
151
|
+
redirectPage = "index",
|
|
152
|
+
profilePage = "profile",
|
|
153
|
+
profileFormPage,
|
|
154
|
+
otpPage = "login-otp",
|
|
155
|
+
type,
|
|
156
|
+
loginType = "password",
|
|
157
|
+
privacyLink = "/terms",
|
|
158
|
+
userParams = {}
|
|
159
|
+
} = defineProps({
|
|
145
160
|
logo: { type: String, required: false },
|
|
146
161
|
head: { type: String, required: false },
|
|
147
162
|
type: { type: String, required: true },
|
|
@@ -154,7 +169,9 @@ const { successLoginAlert = "\u062E\u0648\u0634 \u0622\u0645\u062F\u06CC\u062F",
|
|
|
154
169
|
profilePage: { type: String, required: false },
|
|
155
170
|
profileFormPage: { type: String, required: false },
|
|
156
171
|
loginPage: { type: String, required: false },
|
|
172
|
+
registerPage: { type: String, required: false },
|
|
157
173
|
passLoginPage: { type: String, required: false },
|
|
174
|
+
privacyLink: { type: String, required: false },
|
|
158
175
|
successLoginAlert: { type: String, required: false },
|
|
159
176
|
title: { type: String, required: false },
|
|
160
177
|
buttonTitle: { type: String, required: false },
|
|
@@ -167,24 +184,24 @@ const { $toast } = useNuxtApp();
|
|
|
167
184
|
const { t } = useI18n();
|
|
168
185
|
const loading = ref(false);
|
|
169
186
|
const phoneNumber = useCookie("phoneNumber");
|
|
170
|
-
const
|
|
187
|
+
const data = ref({});
|
|
171
188
|
const expiredAt = useCookie("expiredAt", {
|
|
172
189
|
maxAge: 365 * 24 * 60 * 60 * 1e3
|
|
173
190
|
});
|
|
174
191
|
const ButtonTitle = computed(
|
|
175
192
|
() => type === "login" && loginType == "otp" ? t("\u0627\u0631\u0633\u0627\u0644 \u06A9\u062F") : type === "login" && loginType == "password" ? t("\u0648\u0631\u0648\u062F") : type === "otp" ? t("\u062A\u0627\u06CC\u06CC\u062F") : type === "recover" ? t("\u062B\u0628\u062A") : type === "register" ? t("\u062B\u0628\u062A \u0646\u0627\u0645") : ""
|
|
176
193
|
);
|
|
177
|
-
const isValid = computed(() =>
|
|
194
|
+
const isValid = computed(() => data.value.phoneNumber && data.value.phoneNumber?.length === 11);
|
|
178
195
|
const loginByOtp = async () => {
|
|
179
196
|
if (!isValid.value || loading.value) return;
|
|
180
197
|
loading.value = true;
|
|
181
198
|
const { result } = await usePost("/login-by-phone-otp", {
|
|
182
|
-
phoneNumber: p2e(
|
|
199
|
+
phoneNumber: p2e(data.value.phoneNumber)
|
|
183
200
|
// template: template[config.userType]
|
|
184
201
|
});
|
|
185
202
|
if (result) {
|
|
186
203
|
expiredAt.value = result.expiredAt;
|
|
187
|
-
phoneNumber.value = p2e(
|
|
204
|
+
phoneNumber.value = p2e(data.value.phoneNumber);
|
|
188
205
|
await navigateTo({ name: otpPage, query: route.query });
|
|
189
206
|
}
|
|
190
207
|
loading.value = false;
|
|
@@ -198,7 +215,7 @@ if (["login", "register"].includes(type) && token.value && userId.value) {
|
|
|
198
215
|
const user = useUser();
|
|
199
216
|
const isExpired = ref(false);
|
|
200
217
|
const disable = computed(
|
|
201
|
-
() => type === "login" && loginType == "otp" ? !
|
|
218
|
+
() => type === "login" && loginType == "otp" ? !data.value?.phoneNumber : type === "login" && loginType == "password" ? !data.value?.phoneNumber || !data.value?.password : type === "otp" ? otp.value?.length < 6 : type === "recover" ? !data.value?.password || !data.value?.confirmedPassword || data.value?.password !== data.value?.confirmedPassword : type === "register" ? !data.value?.phoneNumber || !data.value?.password : false
|
|
202
219
|
);
|
|
203
220
|
let ac;
|
|
204
221
|
const getOtpFromPhone = async () => {
|
|
@@ -261,7 +278,7 @@ const setPassword = async () => {
|
|
|
261
278
|
if (loading.value) return;
|
|
262
279
|
loading.value = true;
|
|
263
280
|
const { result } = await usePost("/set-pass", {
|
|
264
|
-
password:
|
|
281
|
+
password: data.value.password
|
|
265
282
|
}, {
|
|
266
283
|
headers: {
|
|
267
284
|
"no-error": true
|
|
@@ -280,8 +297,8 @@ const loginByPass = async () => {
|
|
|
280
297
|
if (loading.value) return;
|
|
281
298
|
loading.value = true;
|
|
282
299
|
const { result } = await usePost("/login-by-pass", {
|
|
283
|
-
phoneNumber: p2e(
|
|
284
|
-
password:
|
|
300
|
+
phoneNumber: p2e(data.value.phoneNumber),
|
|
301
|
+
password: data.value.password
|
|
285
302
|
}, {
|
|
286
303
|
params: {
|
|
287
304
|
"with-profile": true,
|
|
@@ -11,12 +11,14 @@ type Props = {
|
|
|
11
11
|
profilePage?: string;
|
|
12
12
|
profileFormPage?: string;
|
|
13
13
|
loginPage?: string;
|
|
14
|
+
registerPage?: string;
|
|
14
15
|
passLoginPage?: string;
|
|
16
|
+
privacyLink?: string;
|
|
15
17
|
successLoginAlert?: string;
|
|
16
18
|
title?: string;
|
|
17
19
|
buttonTitle?: string;
|
|
18
20
|
forgetPassword?: boolean;
|
|
19
|
-
click?: Record<string,
|
|
21
|
+
click?: Record<string, unknown>;
|
|
20
22
|
shortHand?: boolean;
|
|
21
23
|
};
|
|
22
24
|
declare var __VLS_29: {};
|
|
@@ -11,13 +11,13 @@ type __VLS_Props = {
|
|
|
11
11
|
forgetPage?: string;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_ModelProps = {
|
|
14
|
-
modelValue: Record<string,
|
|
14
|
+
modelValue: Record<string, unknown>;
|
|
15
15
|
};
|
|
16
16
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
-
"update:modelValue": (value: Record<string,
|
|
18
|
+
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
19
19
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
-
"onUpdate:modelValue"?: ((value: Record<string,
|
|
20
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
21
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
@@ -11,13 +11,13 @@ type __VLS_Props = {
|
|
|
11
11
|
forgetPage?: string;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_ModelProps = {
|
|
14
|
-
modelValue: Record<string,
|
|
14
|
+
modelValue: Record<string, unknown>;
|
|
15
15
|
};
|
|
16
16
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
-
"update:modelValue": (value: Record<string,
|
|
18
|
+
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
19
19
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
-
"onUpdate:modelValue"?: ((value: Record<string,
|
|
20
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
21
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|