@yourgoods/ui-smart 0.1.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/ProfileEmailDialog-_CmzDM2p.js +777 -0
- package/dist/ProfilePasswordDialog-DTLqgHqm.js +268 -0
- package/dist/ProfilePhoneDialog-D4EwUMe2.js +737 -0
- package/dist/components/PEditUserContact/PEditUserContact.vue.d.ts +44 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogManager.vue.d.ts +24 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewEmailContent.vue.d.ts +60 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPasswordContent.vue.d.ts +25 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts +63 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewEmailContent.vue.d.ts +64 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewPhoneContent.vue.d.ts +64 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldEmailContent.vue.d.ts +55 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldPhoneContent.vue.d.ts +55 -0
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/ThrottlerTimer.vue.d.ts +45 -0
- package/dist/components/PEditUserContact/ProfileDialogs/ProfileEmailDialog.vue.d.ts +55 -0
- package/dist/components/PEditUserContact/ProfileDialogs/ProfilePasswordDialog.vue.d.ts +36 -0
- package/dist/components/PEditUserContact/ProfileDialogs/ProfilePhoneDialog.vue.d.ts +89 -0
- package/dist/components/PEditUserContact/ProfileOverlayLoading.vue.d.ts +2 -0
- package/dist/components/PEditUserContact/index.vue.d.ts +36 -0
- package/dist/components/PEditUserContact/types.d.ts +29 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/profile/useDialogManager.d.ts +21 -0
- package/dist/composables/profile/useModeFlow.d.ts +7 -0
- package/dist/composables/profile/usePasswordRateLimitToast.d.ts +9 -0
- package/dist/composables/profile/useRateLimitToast.d.ts +9 -0
- package/dist/composables/profile/useThrottler.d.ts +13 -0
- package/dist/index-DtHlzO1x.js +570 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/locales/index.d.ts +130 -0
- package/dist/modules/api/profile/check-availability.d.ts +1 -0
- package/dist/modules/api/profile/me.d.ts +19 -0
- package/dist/modules/index.d.ts +8 -0
- package/dist/types/vue-shims.d.ts +5 -0
- package/dist/useRateLimitToast-DsEVCh0F.js +140 -0
- package/dist/vue-shims.d.ts +5 -0
- package/package.json +49 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ModeType } from '../../../composables/profile/useDialogManager';
|
|
3
|
+
import { CurrentStepType, EmitToastType, LangFormatType, ProviderType } from '../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
modelValue: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
hintText?: string;
|
|
8
|
+
initialPhone?: string;
|
|
9
|
+
language: LangFormatType;
|
|
10
|
+
provider: ProviderType;
|
|
11
|
+
mode?: ModeType;
|
|
12
|
+
}
|
|
13
|
+
declare function handleOldCodeError(payload: {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
}): void;
|
|
17
|
+
declare function handleNewCodeError(payload: {
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}): void;
|
|
21
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
22
|
+
localVisible: Ref<boolean, boolean>;
|
|
23
|
+
form: {
|
|
24
|
+
oldPhone: string;
|
|
25
|
+
newPhone: string;
|
|
26
|
+
code: string;
|
|
27
|
+
addPhone: string;
|
|
28
|
+
addCode: string;
|
|
29
|
+
};
|
|
30
|
+
currentStep: Ref<CurrentStepType, CurrentStepType>;
|
|
31
|
+
loading: Ref<boolean, boolean>;
|
|
32
|
+
rateLimitText: import('vue').ComputedRef<string>;
|
|
33
|
+
isAvailable: import('vue').ComputedRef<boolean>;
|
|
34
|
+
title: import('vue').ComputedRef<string>;
|
|
35
|
+
hintText: import('vue').ComputedRef<string>;
|
|
36
|
+
handleClose: () => void;
|
|
37
|
+
sendContactCode: ({ value, offLoading }?: {
|
|
38
|
+
value?: string;
|
|
39
|
+
offLoading?: boolean;
|
|
40
|
+
}) => Promise<import('axios').AxiosResponse<any, any, {}>>;
|
|
41
|
+
sendBindContactCode: ({ value, field, offLoading }?: {
|
|
42
|
+
value?: string;
|
|
43
|
+
field?: "email" | "phone";
|
|
44
|
+
offLoading?: boolean;
|
|
45
|
+
}) => Promise<import('axios').AxiosResponse<any, any, {}>>;
|
|
46
|
+
handleOldCodeSuccess: ({ code }: {
|
|
47
|
+
code: string;
|
|
48
|
+
}) => Promise<import('axios').AxiosResponse<any, any, {}> | undefined>;
|
|
49
|
+
handleOldCodeError: typeof handleOldCodeError;
|
|
50
|
+
handleNewCodeSuccess: ({ code }: {
|
|
51
|
+
code: string;
|
|
52
|
+
}) => Promise<import('axios').AxiosResponse<any, any, {}> | undefined>;
|
|
53
|
+
handleNewCodeError: typeof handleNewCodeError;
|
|
54
|
+
matchBindCode: ({ code }: {
|
|
55
|
+
phone?: string;
|
|
56
|
+
code: string;
|
|
57
|
+
}) => Promise<import('axios').AxiosResponse<any, any, {}> | undefined>;
|
|
58
|
+
matchBindCodeError: () => Promise<void>;
|
|
59
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
60
|
+
edit: (field: "phone") => any;
|
|
61
|
+
close: () => any;
|
|
62
|
+
"update:modelValue": (value: boolean) => any;
|
|
63
|
+
"on-toast": (data: EmitToastType) => any;
|
|
64
|
+
"clean-input-errors": () => any;
|
|
65
|
+
"on-update-jwt": (flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any;
|
|
66
|
+
"submit-phone": (payload: {
|
|
67
|
+
phone: string;
|
|
68
|
+
code: string;
|
|
69
|
+
}) => any;
|
|
70
|
+
"update-phone-field": (value: string) => any;
|
|
71
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
72
|
+
onEdit?: ((field: "phone") => any) | undefined;
|
|
73
|
+
onClose?: (() => any) | undefined;
|
|
74
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
75
|
+
"onOn-toast"?: ((data: EmitToastType) => any) | undefined;
|
|
76
|
+
"onClean-input-errors"?: (() => any) | undefined;
|
|
77
|
+
"onOn-update-jwt"?: ((flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any) | undefined;
|
|
78
|
+
"onSubmit-phone"?: ((payload: {
|
|
79
|
+
phone: string;
|
|
80
|
+
code: string;
|
|
81
|
+
}) => any) | undefined;
|
|
82
|
+
"onUpdate-phone-field"?: ((value: string) => any) | undefined;
|
|
83
|
+
}>, {
|
|
84
|
+
title: string;
|
|
85
|
+
hintText: string;
|
|
86
|
+
mode: ModeType;
|
|
87
|
+
initialPhone: string;
|
|
88
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
89
|
+
export default _default;
|
|
@@ -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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ModeType } from '../../composables/profile/useDialogManager';
|
|
2
|
+
import { LangFormatType, ProviderType } from './types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<{
|
|
4
|
+
throttlerPrefix: string;
|
|
5
|
+
provider: ProviderType;
|
|
6
|
+
requestUrl: string;
|
|
7
|
+
accessToken: string;
|
|
8
|
+
refreshToken: string;
|
|
9
|
+
language: LangFormatType;
|
|
10
|
+
fields: Array<{
|
|
11
|
+
key: "firstName" | "lastName" | "email" | "phone" | "avatar";
|
|
12
|
+
label?: string;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
type?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
17
|
+
"on-update-jwt": (flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any;
|
|
18
|
+
"update-tokens": (accessToken: string, refreshToken: string) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
20
|
+
throttlerPrefix: string;
|
|
21
|
+
provider: ProviderType;
|
|
22
|
+
requestUrl: string;
|
|
23
|
+
accessToken: string;
|
|
24
|
+
refreshToken: string;
|
|
25
|
+
language: LangFormatType;
|
|
26
|
+
fields: Array<{
|
|
27
|
+
key: "firstName" | "lastName" | "email" | "phone" | "avatar";
|
|
28
|
+
label?: string;
|
|
29
|
+
readonly?: boolean;
|
|
30
|
+
type?: string;
|
|
31
|
+
}>;
|
|
32
|
+
}> & Readonly<{
|
|
33
|
+
"onOn-update-jwt"?: ((flow?: "email" | "phone" | "password" | undefined, mode?: ModeType | undefined, newValue?: string | undefined) => any) | undefined;
|
|
34
|
+
"onUpdate-tokens"?: ((accessToken: string, refreshToken: string) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare function formatFileSize(bytes: number, decimals?: number): string;
|
|
2
|
+
export declare function formatMimeTypes(mimeTypes: string[]): string[];
|
|
3
|
+
export interface EmitToastType {
|
|
4
|
+
color: 'default' | 'error' | 'success' | undefined;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export type ProviderType = 'crm' | 'widget' | 'sendbot' | 'planner' | 'logic' | 'dengi';
|
|
8
|
+
export type LangFormatType = 'ru' | 'en';
|
|
9
|
+
export declare const CURRENT_STEP: {
|
|
10
|
+
readonly OLD: "old";
|
|
11
|
+
readonly NEW: "new";
|
|
12
|
+
readonly COMPLETED: "completed";
|
|
13
|
+
};
|
|
14
|
+
export declare const BIND_PASSWORD_CURRENT_STEP: {
|
|
15
|
+
readonly VERIFY_EMAIL: "verify-email";
|
|
16
|
+
readonly PASSWORD_FLOW: "password-flow";
|
|
17
|
+
readonly COMPLETED: "completed";
|
|
18
|
+
};
|
|
19
|
+
export declare const DeliveryMethod: {
|
|
20
|
+
readonly SMS: "sms";
|
|
21
|
+
readonly TG: "tg";
|
|
22
|
+
};
|
|
23
|
+
export declare const ThrottlerMeta: {
|
|
24
|
+
RETRY: string;
|
|
25
|
+
};
|
|
26
|
+
export type ActiveStepType = Exclude<CurrentStepType, typeof CURRENT_STEP.OLD>;
|
|
27
|
+
export type CurrentStepType = (typeof CURRENT_STEP)[keyof typeof CURRENT_STEP];
|
|
28
|
+
export type BindPasswordStepType = (typeof BIND_PASSWORD_CURRENT_STEP)[keyof typeof BIND_PASSWORD_CURRENT_STEP];
|
|
29
|
+
export type DeliveryMethodType = (typeof DeliveryMethod)[keyof typeof DeliveryMethod];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PEditUserContact } from './PEditUserContact/index.vue';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type DialogKey = keyof DialogPayloadMap | null;
|
|
2
|
+
export type ModeType = 'edit' | 'bind';
|
|
3
|
+
export interface DialogPayloadMap {
|
|
4
|
+
email: {
|
|
5
|
+
initialEmail?: string;
|
|
6
|
+
mode: ModeType;
|
|
7
|
+
};
|
|
8
|
+
phone: {
|
|
9
|
+
initialPhone?: string;
|
|
10
|
+
mode: ModeType;
|
|
11
|
+
};
|
|
12
|
+
password: {};
|
|
13
|
+
}
|
|
14
|
+
export declare function useDialogManager(): {
|
|
15
|
+
currentDialog: import('vue').Ref<DialogKey, DialogKey>;
|
|
16
|
+
dialogPayload: import('vue').ShallowRef<any, any>;
|
|
17
|
+
openDialog: <K extends keyof DialogPayloadMap>(name: K, payload?: DialogPayloadMap[K]) => void;
|
|
18
|
+
closeDialog: () => void;
|
|
19
|
+
isDialogOpen: <K extends keyof DialogPayloadMap>(name: K) => boolean;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ModeType } from './useDialogManager';
|
|
3
|
+
export declare function useFlow(modeProp: Ref<ModeType>): {
|
|
4
|
+
modeFlowFromBack: Ref<ModeType, ModeType>;
|
|
5
|
+
isEditFlow: import('vue').ComputedRef<boolean>;
|
|
6
|
+
getFlow: (field: "email" | "phone" | "password") => Promise<ModeType>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface PasswordRateLimit {
|
|
2
|
+
attemptsLeft: number;
|
|
3
|
+
maxAttempts: number;
|
|
4
|
+
retryAfterSec: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function usePasswordRateLimitToast(emit: any): {
|
|
7
|
+
showPasswordRateLimitToast: (rateLimit?: PasswordRateLimit | null) => void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function formattedTime(input: number): string;
|
|
3
|
+
type StartTimer = (seconds: number, end?: () => void) => void;
|
|
4
|
+
interface UseRateLimitTimer {
|
|
5
|
+
startTimer: StartTimer;
|
|
6
|
+
isShowRateTimers: Ref<boolean>;
|
|
7
|
+
remainingSeconds: Ref<string>;
|
|
8
|
+
totalRateAttempts: Ref<number>;
|
|
9
|
+
currentRateAttempt: Ref<number>;
|
|
10
|
+
isAvailableForSendAgain: Ref<boolean>;
|
|
11
|
+
}
|
|
12
|
+
export declare function useRateLimitTimer(): UseRateLimitTimer;
|
|
13
|
+
export {};
|