@unsource/ui 2.2.0 → 2.2.1
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 +2 -0
- package/dist/runtime/assets/main.css +130 -0
- package/dist/runtime/assets/transition.css +63 -0
- package/dist/runtime/components/UnAuth.d.vue.ts +2 -1
- package/dist/runtime/components/UnAuth.vue +42 -27
- package/dist/runtime/components/UnAuth.vue.d.ts +2 -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
package/dist/module.mjs
CHANGED
|
@@ -85,6 +85,8 @@ const module = defineNuxtModule({
|
|
|
85
85
|
});
|
|
86
86
|
addImportsDir(resolver2.resolve("runtime/composables"));
|
|
87
87
|
addPlugin(resolver2.resolve("runtime/plugins/toast.client"));
|
|
88
|
+
_nuxt.options.css.push("@unocss/reset/normalize.css");
|
|
89
|
+
_nuxt.options.css.push(resolver2.resolve("./runtime/assets/main.scss"));
|
|
88
90
|
}
|
|
89
91
|
});
|
|
90
92
|
|
|
@@ -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,13 @@ type Props = {
|
|
|
11
11
|
profilePage?: string;
|
|
12
12
|
profileFormPage?: string;
|
|
13
13
|
loginPage?: string;
|
|
14
|
+
registerPage?: string;
|
|
14
15
|
passLoginPage?: string;
|
|
15
16
|
successLoginAlert?: string;
|
|
16
17
|
title?: string;
|
|
17
18
|
buttonTitle?: string;
|
|
18
19
|
forgetPassword?: boolean;
|
|
19
|
-
click?: Record<string,
|
|
20
|
+
click?: Record<string, unknown>;
|
|
20
21
|
shortHand?: boolean;
|
|
21
22
|
};
|
|
22
23
|
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"
|
|
@@ -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,18 @@ 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
|
+
userParams = {}
|
|
158
|
+
} = defineProps({
|
|
145
159
|
logo: { type: String, required: false },
|
|
146
160
|
head: { type: String, required: false },
|
|
147
161
|
type: { type: String, required: true },
|
|
@@ -154,6 +168,7 @@ const { successLoginAlert = "\u062E\u0648\u0634 \u0622\u0645\u062F\u06CC\u062F",
|
|
|
154
168
|
profilePage: { type: String, required: false },
|
|
155
169
|
profileFormPage: { type: String, required: false },
|
|
156
170
|
loginPage: { type: String, required: false },
|
|
171
|
+
registerPage: { type: String, required: false },
|
|
157
172
|
passLoginPage: { type: String, required: false },
|
|
158
173
|
successLoginAlert: { type: String, required: false },
|
|
159
174
|
title: { type: String, required: false },
|
|
@@ -167,24 +182,24 @@ const { $toast } = useNuxtApp();
|
|
|
167
182
|
const { t } = useI18n();
|
|
168
183
|
const loading = ref(false);
|
|
169
184
|
const phoneNumber = useCookie("phoneNumber");
|
|
170
|
-
const
|
|
185
|
+
const data = ref({});
|
|
171
186
|
const expiredAt = useCookie("expiredAt", {
|
|
172
187
|
maxAge: 365 * 24 * 60 * 60 * 1e3
|
|
173
188
|
});
|
|
174
189
|
const ButtonTitle = computed(
|
|
175
190
|
() => 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
191
|
);
|
|
177
|
-
const isValid = computed(() =>
|
|
192
|
+
const isValid = computed(() => data.value.phoneNumber && data.value.phoneNumber?.length === 11);
|
|
178
193
|
const loginByOtp = async () => {
|
|
179
194
|
if (!isValid.value || loading.value) return;
|
|
180
195
|
loading.value = true;
|
|
181
196
|
const { result } = await usePost("/login-by-phone-otp", {
|
|
182
|
-
phoneNumber: p2e(
|
|
197
|
+
phoneNumber: p2e(data.value.phoneNumber)
|
|
183
198
|
// template: template[config.userType]
|
|
184
199
|
});
|
|
185
200
|
if (result) {
|
|
186
201
|
expiredAt.value = result.expiredAt;
|
|
187
|
-
phoneNumber.value = p2e(
|
|
202
|
+
phoneNumber.value = p2e(data.value.phoneNumber);
|
|
188
203
|
await navigateTo({ name: otpPage, query: route.query });
|
|
189
204
|
}
|
|
190
205
|
loading.value = false;
|
|
@@ -198,7 +213,7 @@ if (["login", "register"].includes(type) && token.value && userId.value) {
|
|
|
198
213
|
const user = useUser();
|
|
199
214
|
const isExpired = ref(false);
|
|
200
215
|
const disable = computed(
|
|
201
|
-
() => type === "login" && loginType == "otp" ? !
|
|
216
|
+
() => 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
217
|
);
|
|
203
218
|
let ac;
|
|
204
219
|
const getOtpFromPhone = async () => {
|
|
@@ -261,7 +276,7 @@ const setPassword = async () => {
|
|
|
261
276
|
if (loading.value) return;
|
|
262
277
|
loading.value = true;
|
|
263
278
|
const { result } = await usePost("/set-pass", {
|
|
264
|
-
password:
|
|
279
|
+
password: data.value.password
|
|
265
280
|
}, {
|
|
266
281
|
headers: {
|
|
267
282
|
"no-error": true
|
|
@@ -280,8 +295,8 @@ const loginByPass = async () => {
|
|
|
280
295
|
if (loading.value) return;
|
|
281
296
|
loading.value = true;
|
|
282
297
|
const { result } = await usePost("/login-by-pass", {
|
|
283
|
-
phoneNumber: p2e(
|
|
284
|
-
password:
|
|
298
|
+
phoneNumber: p2e(data.value.phoneNumber),
|
|
299
|
+
password: data.value.password
|
|
285
300
|
}, {
|
|
286
301
|
params: {
|
|
287
302
|
"with-profile": true,
|
|
@@ -11,12 +11,13 @@ type Props = {
|
|
|
11
11
|
profilePage?: string;
|
|
12
12
|
profileFormPage?: string;
|
|
13
13
|
loginPage?: string;
|
|
14
|
+
registerPage?: string;
|
|
14
15
|
passLoginPage?: string;
|
|
15
16
|
successLoginAlert?: string;
|
|
16
17
|
title?: string;
|
|
17
18
|
buttonTitle?: string;
|
|
18
19
|
forgetPassword?: boolean;
|
|
19
|
-
click?: Record<string,
|
|
20
|
+
click?: Record<string, unknown>;
|
|
20
21
|
shortHand?: boolean;
|
|
21
22
|
};
|
|
22
23
|
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;
|