jk-vue-comps 0.2.13 → 0.2.15
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/components/GoogleAuth.d.ts +83 -1
- package/dist/components/TelegramAuth.d.ts +88 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/useCopyToClipboard.d.ts +9 -1
- package/dist/hooks/useFormKeypressEnter.d.ts +2 -1
- package/dist/hooks/useMemo.d.ts +2 -1
- package/dist/index.d.ts +226 -1
- package/dist/utils/index.d.ts +55 -1
- package/dist/utils/is.d.ts +59 -1
- package/dist/utils/lodash.d.ts +39 -1
- package/dist/utils/math.d.ts +113 -1
- package/dist/utils/timeZone.d.ts +9 -1
- package/dist/utils/vuePropTypes.d.ts +17 -1
- package/dist/utils/withInstall.d.ts +3 -1
- package/package.json +2 -2
- package/dist/src/components/GoogleAuth.d.ts +0 -83
- package/dist/src/components/TelegramAuth.d.ts +0 -88
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts +0 -3
- package/dist/src/hooks/useCopyToClipboard.d.ts +0 -9
- package/dist/src/hooks/useFormKeypressEnter.d.ts +0 -2
- package/dist/src/hooks/useMemo.d.ts +0 -2
- package/dist/src/index.d.ts +0 -226
- package/dist/src/utils/index.d.ts +0 -55
- package/dist/src/utils/is.d.ts +0 -59
- package/dist/src/utils/lodash.d.ts +0 -39
- package/dist/src/utils/math.d.ts +0 -113
- package/dist/src/utils/timeZone.d.ts +0 -9
- package/dist/src/utils/vuePropTypes.d.ts +0 -17
- package/dist/src/utils/withInstall.d.ts +0 -3
|
@@ -1 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropType, ExtractPropTypes, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps, Plugin } from 'vue';
|
|
2
|
+
/** 跳转谷歌身份检查 */
|
|
3
|
+
export declare function toGoogleAuth(clientId: string, redirectUri: string): void;
|
|
4
|
+
type GetPopupContainerFn = () => HTMLElement | Element;
|
|
5
|
+
declare const _comp_props: {
|
|
6
|
+
clientId: StringConstructor;
|
|
7
|
+
redirectUri: StringConstructor;
|
|
8
|
+
defaultLoad: BooleanConstructor;
|
|
9
|
+
getPopupContainer: {
|
|
10
|
+
type: PropType<GetPopupContainerFn>;
|
|
11
|
+
};
|
|
12
|
+
onCallback: {
|
|
13
|
+
type: PropType<(data: {
|
|
14
|
+
code: string;
|
|
15
|
+
}) => void>;
|
|
16
|
+
};
|
|
17
|
+
onRejectCallback: {
|
|
18
|
+
type: PropType<(error: any) => void>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type GoogleAuthProps = Partial<ExtractPropTypes<typeof _comp_props>>;
|
|
22
|
+
/** 谷歌身份检查 */
|
|
23
|
+
export declare const GoogleAuth: {
|
|
24
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<Partial<ExtractPropTypes<{
|
|
25
|
+
clientId: StringConstructor;
|
|
26
|
+
redirectUri: StringConstructor;
|
|
27
|
+
defaultLoad: BooleanConstructor;
|
|
28
|
+
getPopupContainer: {
|
|
29
|
+
type: PropType<GetPopupContainerFn>;
|
|
30
|
+
};
|
|
31
|
+
onCallback: {
|
|
32
|
+
type: PropType<(data: {
|
|
33
|
+
code: string;
|
|
34
|
+
}) => void>;
|
|
35
|
+
};
|
|
36
|
+
onRejectCallback: {
|
|
37
|
+
type: PropType<(error: any) => void>;
|
|
38
|
+
};
|
|
39
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
40
|
+
P: {};
|
|
41
|
+
B: {};
|
|
42
|
+
D: {};
|
|
43
|
+
C: {};
|
|
44
|
+
M: {};
|
|
45
|
+
Defaults: {};
|
|
46
|
+
}, Readonly<Partial<ExtractPropTypes<{
|
|
47
|
+
clientId: StringConstructor;
|
|
48
|
+
redirectUri: StringConstructor;
|
|
49
|
+
defaultLoad: BooleanConstructor;
|
|
50
|
+
getPopupContainer: {
|
|
51
|
+
type: PropType<GetPopupContainerFn>;
|
|
52
|
+
};
|
|
53
|
+
onCallback: {
|
|
54
|
+
type: PropType<(data: {
|
|
55
|
+
code: string;
|
|
56
|
+
}) => void>;
|
|
57
|
+
};
|
|
58
|
+
onRejectCallback: {
|
|
59
|
+
type: PropType<(error: any) => void>;
|
|
60
|
+
};
|
|
61
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
62
|
+
__isFragment?: never;
|
|
63
|
+
__isTeleport?: never;
|
|
64
|
+
__isSuspense?: never;
|
|
65
|
+
} & ComponentOptionsBase<Readonly<Partial<ExtractPropTypes<{
|
|
66
|
+
clientId: StringConstructor;
|
|
67
|
+
redirectUri: StringConstructor;
|
|
68
|
+
defaultLoad: BooleanConstructor;
|
|
69
|
+
getPopupContainer: {
|
|
70
|
+
type: PropType<GetPopupContainerFn>;
|
|
71
|
+
};
|
|
72
|
+
onCallback: {
|
|
73
|
+
type: PropType<(data: {
|
|
74
|
+
code: string;
|
|
75
|
+
}) => void>;
|
|
76
|
+
};
|
|
77
|
+
onRejectCallback: {
|
|
78
|
+
type: PropType<(error: any) => void>;
|
|
79
|
+
};
|
|
80
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
81
|
+
readonly toGoogleAuth: typeof toGoogleAuth;
|
|
82
|
+
} & Plugin;
|
|
83
|
+
export default GoogleAuth;
|
|
@@ -1 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropType, ExtractPropTypes, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps, Plugin } from 'vue';
|
|
2
|
+
/** 跳转Telegram身份检查 */
|
|
3
|
+
export declare function toTelegramAuth(botId: number, toPath: string): void;
|
|
4
|
+
/** 获取路由中的Telegram身份检查回调参数 */
|
|
5
|
+
export declare function getTelegramAuthUrlParams(): TgUserData | null;
|
|
6
|
+
/** tg用户信息 */
|
|
7
|
+
export interface TgUserData {
|
|
8
|
+
auth_date: number;
|
|
9
|
+
first_name: string;
|
|
10
|
+
hash: string;
|
|
11
|
+
id: number;
|
|
12
|
+
last_name: string;
|
|
13
|
+
photo_url: string;
|
|
14
|
+
username: string;
|
|
15
|
+
}
|
|
16
|
+
type GetPopupContainerFn = () => HTMLElement | Element;
|
|
17
|
+
declare const _comp_props: {
|
|
18
|
+
botId: NumberConstructor;
|
|
19
|
+
toPath: StringConstructor;
|
|
20
|
+
defaultLoad: BooleanConstructor;
|
|
21
|
+
getPopupContainer: {
|
|
22
|
+
type: PropType<GetPopupContainerFn>;
|
|
23
|
+
};
|
|
24
|
+
onCallback: {
|
|
25
|
+
type: PropType<(user: TgUserData) => void>;
|
|
26
|
+
};
|
|
27
|
+
onRejectCallback: {
|
|
28
|
+
type: PropType<() => void>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type TelegramAuthProps = Partial<ExtractPropTypes<typeof _comp_props>>;
|
|
32
|
+
/** Telegram身份检查 */
|
|
33
|
+
export declare const TelegramAuth: {
|
|
34
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<Partial<ExtractPropTypes<{
|
|
35
|
+
botId: NumberConstructor;
|
|
36
|
+
toPath: StringConstructor;
|
|
37
|
+
defaultLoad: BooleanConstructor;
|
|
38
|
+
getPopupContainer: {
|
|
39
|
+
type: PropType<GetPopupContainerFn>;
|
|
40
|
+
};
|
|
41
|
+
onCallback: {
|
|
42
|
+
type: PropType<(user: TgUserData) => void>;
|
|
43
|
+
};
|
|
44
|
+
onRejectCallback: {
|
|
45
|
+
type: PropType<() => void>;
|
|
46
|
+
};
|
|
47
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
48
|
+
P: {};
|
|
49
|
+
B: {};
|
|
50
|
+
D: {};
|
|
51
|
+
C: {};
|
|
52
|
+
M: {};
|
|
53
|
+
Defaults: {};
|
|
54
|
+
}, Readonly<Partial<ExtractPropTypes<{
|
|
55
|
+
botId: NumberConstructor;
|
|
56
|
+
toPath: StringConstructor;
|
|
57
|
+
defaultLoad: BooleanConstructor;
|
|
58
|
+
getPopupContainer: {
|
|
59
|
+
type: PropType<GetPopupContainerFn>;
|
|
60
|
+
};
|
|
61
|
+
onCallback: {
|
|
62
|
+
type: PropType<(user: TgUserData) => void>;
|
|
63
|
+
};
|
|
64
|
+
onRejectCallback: {
|
|
65
|
+
type: PropType<() => void>;
|
|
66
|
+
};
|
|
67
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
68
|
+
__isFragment?: never;
|
|
69
|
+
__isTeleport?: never;
|
|
70
|
+
__isSuspense?: never;
|
|
71
|
+
} & ComponentOptionsBase<Readonly<Partial<ExtractPropTypes<{
|
|
72
|
+
botId: NumberConstructor;
|
|
73
|
+
toPath: StringConstructor;
|
|
74
|
+
defaultLoad: BooleanConstructor;
|
|
75
|
+
getPopupContainer: {
|
|
76
|
+
type: PropType<GetPopupContainerFn>;
|
|
77
|
+
};
|
|
78
|
+
onCallback: {
|
|
79
|
+
type: PropType<(user: TgUserData) => void>;
|
|
80
|
+
};
|
|
81
|
+
onRejectCallback: {
|
|
82
|
+
type: PropType<() => void>;
|
|
83
|
+
};
|
|
84
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
85
|
+
readonly toTelegramAuth: typeof toTelegramAuth;
|
|
86
|
+
readonly getTelegramAuthUrlParams: typeof getTelegramAuthUrlParams;
|
|
87
|
+
} & Plugin;
|
|
88
|
+
export default TelegramAuth;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './GoogleAuth';
|
|
2
|
+
export * from './TelegramAuth';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare function useCopyToClipboard(initial?: string): {
|
|
3
|
+
clipboardRef: Ref<string, string>;
|
|
4
|
+
isSuccessRef: Ref<boolean, boolean>;
|
|
5
|
+
copiedRef: Ref<boolean, boolean>;
|
|
6
|
+
};
|
|
7
|
+
export declare function copyTextToClipboard(input: string, { target }?: {
|
|
8
|
+
target?: HTMLElement;
|
|
9
|
+
}): boolean;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { WatchSource } from 'vue';
|
|
2
|
+
export declare function useFormKeypressEnter<T extends (...args: any[]) => any, L extends WatchSource<boolean>>(fn: T, loading: L): (...args: any[]) => any;
|
package/dist/hooks/useMemo.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Ref, WatchSource } from 'vue';
|
|
2
|
+
export declare function useMemo<T>(getValue: () => T, condition: (WatchSource<unknown> | object)[], shouldUpdate?: (prev: any[], next: any[]) => boolean): Ref<T, T>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,226 @@
|
|
|
1
|
-
|
|
1
|
+
import { VNode, RendererNode, RendererElement, Plugin, Ref, WatchSource, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
|
|
2
|
+
import { BigNumber } from 'bignumber.js';
|
|
3
|
+
import { default as __DTS_DEFAULT_0__ } from './utils/vuePropTypes';
|
|
4
|
+
import * as Comps from './components';
|
|
5
|
+
import * as Hooks from './hooks';
|
|
6
|
+
import * as Utils from './utils';
|
|
7
|
+
export * from './components';
|
|
8
|
+
export * from './hooks';
|
|
9
|
+
export * from './utils';
|
|
10
|
+
declare const JKVUEComps: {
|
|
11
|
+
Comps: typeof Comps;
|
|
12
|
+
Hooks: typeof Hooks;
|
|
13
|
+
Utils: typeof Utils;
|
|
14
|
+
evalPro(str: string): any;
|
|
15
|
+
filterInputNum(eventVal: string | number, type?: "int" | "float", maxDecimal?: number): string;
|
|
16
|
+
generateFilterInputNumFn<T extends Recordable, K extends keyof T>(obj: T, key: K, fn?: () => void, type?: "float" | "int", maxDecimal?: number): (e: ChangeEvent) => void;
|
|
17
|
+
renderHtmlStr(html: string): string | VNode<RendererNode, RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>;
|
|
20
|
+
getWebsiteUrl(): string;
|
|
21
|
+
getRouterParams(): Recordable<any> | undefined;
|
|
22
|
+
removeWhitespace(str: any): string;
|
|
23
|
+
deepMerge<T = any>(src?: any, target?: any): T;
|
|
24
|
+
desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
|
|
25
|
+
showPrefix?: boolean;
|
|
26
|
+
showSuffix?: boolean;
|
|
27
|
+
middleStr?: string;
|
|
28
|
+
}): string | undefined;
|
|
29
|
+
toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
|
|
30
|
+
toStyleObject(style?: string | Recordable | null): Recordable<any>;
|
|
31
|
+
is(val: unknown, type: string): boolean;
|
|
32
|
+
isDef<T = unknown>(val?: T): val is T;
|
|
33
|
+
isUnDef<T = unknown>(val?: T): val is T;
|
|
34
|
+
isObject(val: any): val is Record<any, any>;
|
|
35
|
+
isDate(val: unknown): val is Date;
|
|
36
|
+
isNull(val: unknown): val is null;
|
|
37
|
+
isNullAndUnDef(val: unknown): val is null | undefined;
|
|
38
|
+
isNullOrUnDef(val: unknown): val is null | undefined;
|
|
39
|
+
isNumber(val: unknown): val is number;
|
|
40
|
+
isString(val: unknown): val is string;
|
|
41
|
+
isFunction(val: unknown): val is (...args: any[]) => any;
|
|
42
|
+
isBoolean(val: unknown): val is boolean;
|
|
43
|
+
isRegExp(val: unknown): val is RegExp;
|
|
44
|
+
isArray(val: any): val is Array<any>;
|
|
45
|
+
isEmpty<T = unknown>(val: T): val is T;
|
|
46
|
+
isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
47
|
+
isPromiseLink<T>(it: T | PromiseLike<T>): it is PromiseLike<T>;
|
|
48
|
+
isWindow(val: any): val is Window;
|
|
49
|
+
isElement(val: unknown): val is Element;
|
|
50
|
+
isMap(val: unknown): val is Map<any, any>;
|
|
51
|
+
isServer(): boolean;
|
|
52
|
+
isClient(): boolean;
|
|
53
|
+
isUrl(path: string): boolean;
|
|
54
|
+
isIp(ip: string): boolean;
|
|
55
|
+
isEmail(v: any): boolean;
|
|
56
|
+
isValidPhoneNumber(phoneNumber: string): boolean;
|
|
57
|
+
isInMobileBrowser(): false | RegExpMatchArray | null;
|
|
58
|
+
isZhLang(lang: string): boolean;
|
|
59
|
+
isEdgeBrowser(): boolean;
|
|
60
|
+
isHtmlStr(str: string): boolean;
|
|
61
|
+
helper(val: Utils.BigNumValType): Utils.BigNumObj;
|
|
62
|
+
isBool(val: any): val is boolean;
|
|
63
|
+
isBigNum(val: any): val is Utils.BigNumObj;
|
|
64
|
+
isNum(val: any): val is number;
|
|
65
|
+
isNanValue(val: any): boolean;
|
|
66
|
+
isInt(val: any): boolean;
|
|
67
|
+
isGreaterThan(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
|
|
68
|
+
isLessThan(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
|
|
69
|
+
isEqualTo(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
|
|
70
|
+
isGreaterThanOrEqualTo(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
|
|
71
|
+
isLessThanOrEqualTo(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
|
|
72
|
+
toBigNum(val: Utils.BigNumValType): BigNumber;
|
|
73
|
+
toNum(val: Utils.BigNumValType): number;
|
|
74
|
+
toInt(val: Utils.BigNumValType, isUp?: boolean): number;
|
|
75
|
+
toString(val: Utils.BigNumValType): string;
|
|
76
|
+
toDecimalPlaces(val: Utils.BigNumValType, decimal?: number, isUp?: boolean): number;
|
|
77
|
+
toLocaleString(val: Utils.BigNumValType): string;
|
|
78
|
+
add(...vals: Utils.BigNumValType[]): number;
|
|
79
|
+
subtract(...vals: Utils.BigNumValType[]): number;
|
|
80
|
+
multiply(...vals: Utils.BigNumValType[]): number;
|
|
81
|
+
divide(...vals: Utils.BigNumValType[]): number;
|
|
82
|
+
power(base: Utils.BigNumValType, exponent: Utils.BigNumValType): number;
|
|
83
|
+
formatRate(val: Utils.BigNumValType, unit?: string): string;
|
|
84
|
+
unFormatRate(val: Utils.BigNumValType): number;
|
|
85
|
+
DOWN: 1;
|
|
86
|
+
UP: 0;
|
|
87
|
+
BigNumber: BigNumber;
|
|
88
|
+
gt: typeof Utils.isGreaterThan;
|
|
89
|
+
gte: typeof Utils.isGreaterThanOrEqualTo;
|
|
90
|
+
lt: typeof Utils.isLessThan;
|
|
91
|
+
lte: typeof Utils.isLessThanOrEqualTo;
|
|
92
|
+
eq: typeof Utils.isEqualTo;
|
|
93
|
+
isNan: typeof Utils.isNanValue;
|
|
94
|
+
propTypes: __DTS_DEFAULT_0__;
|
|
95
|
+
timeZoneOptions: Utils.TimeZoneItem[];
|
|
96
|
+
withInstall<T>(component: T, alias?: string): T & Plugin;
|
|
97
|
+
useCopyToClipboard(initial?: string): {
|
|
98
|
+
clipboardRef: Ref<string, string>;
|
|
99
|
+
isSuccessRef: Ref<boolean, boolean>;
|
|
100
|
+
copiedRef: Ref<boolean, boolean>;
|
|
101
|
+
};
|
|
102
|
+
copyTextToClipboard(input: string, { target }?: {
|
|
103
|
+
target?: HTMLElement;
|
|
104
|
+
}): boolean;
|
|
105
|
+
useFormKeypressEnter<T extends (...args: any[]) => any, L extends WatchSource<boolean>>(fn: T, loading: L): (...args: any[]) => any;
|
|
106
|
+
useMemo<T>(getValue: () => T, condition: ( WatchSource<unknown> | object)[], shouldUpdate?: (prev: any[], next: any[]) => boolean): Ref<T, T>;
|
|
107
|
+
toGoogleAuth(clientId: string, redirectUri: string): void;
|
|
108
|
+
GoogleAuth: {
|
|
109
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<Partial< ExtractPropTypes<{
|
|
110
|
+
clientId: StringConstructor;
|
|
111
|
+
redirectUri: StringConstructor;
|
|
112
|
+
defaultLoad: BooleanConstructor;
|
|
113
|
+
getPopupContainer: {
|
|
114
|
+
type: PropType<() => HTMLElement | Element>;
|
|
115
|
+
};
|
|
116
|
+
onCallback: {
|
|
117
|
+
type: PropType<(data: {
|
|
118
|
+
code: string;
|
|
119
|
+
}) => void>;
|
|
120
|
+
};
|
|
121
|
+
onRejectCallback: {
|
|
122
|
+
type: PropType<(error: any) => void>;
|
|
123
|
+
};
|
|
124
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
125
|
+
P: {};
|
|
126
|
+
B: {};
|
|
127
|
+
D: {};
|
|
128
|
+
C: {};
|
|
129
|
+
M: {};
|
|
130
|
+
Defaults: {};
|
|
131
|
+
}, Readonly<Partial< ExtractPropTypes<{
|
|
132
|
+
clientId: StringConstructor;
|
|
133
|
+
redirectUri: StringConstructor;
|
|
134
|
+
defaultLoad: BooleanConstructor;
|
|
135
|
+
getPopupContainer: {
|
|
136
|
+
type: PropType<() => HTMLElement | Element>;
|
|
137
|
+
};
|
|
138
|
+
onCallback: {
|
|
139
|
+
type: PropType<(data: {
|
|
140
|
+
code: string;
|
|
141
|
+
}) => void>;
|
|
142
|
+
};
|
|
143
|
+
onRejectCallback: {
|
|
144
|
+
type: PropType<(error: any) => void>;
|
|
145
|
+
};
|
|
146
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
147
|
+
__isFragment?: never;
|
|
148
|
+
__isTeleport?: never;
|
|
149
|
+
__isSuspense?: never;
|
|
150
|
+
} & ComponentOptionsBase<Readonly<Partial< ExtractPropTypes<{
|
|
151
|
+
clientId: StringConstructor;
|
|
152
|
+
redirectUri: StringConstructor;
|
|
153
|
+
defaultLoad: BooleanConstructor;
|
|
154
|
+
getPopupContainer: {
|
|
155
|
+
type: PropType<() => HTMLElement | Element>;
|
|
156
|
+
};
|
|
157
|
+
onCallback: {
|
|
158
|
+
type: PropType<(data: {
|
|
159
|
+
code: string;
|
|
160
|
+
}) => void>;
|
|
161
|
+
};
|
|
162
|
+
onRejectCallback: {
|
|
163
|
+
type: PropType<(error: any) => void>;
|
|
164
|
+
};
|
|
165
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
166
|
+
readonly toGoogleAuth: typeof Comps.toGoogleAuth;
|
|
167
|
+
} & Plugin;
|
|
168
|
+
toTelegramAuth(botId: number, toPath: string): void;
|
|
169
|
+
getTelegramAuthUrlParams(): Comps.TgUserData | null;
|
|
170
|
+
TelegramAuth: {
|
|
171
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<Partial< ExtractPropTypes<{
|
|
172
|
+
botId: NumberConstructor;
|
|
173
|
+
toPath: StringConstructor;
|
|
174
|
+
defaultLoad: BooleanConstructor;
|
|
175
|
+
getPopupContainer: {
|
|
176
|
+
type: PropType<() => HTMLElement | Element>;
|
|
177
|
+
};
|
|
178
|
+
onCallback: {
|
|
179
|
+
type: PropType<(user: Comps.TgUserData) => void>;
|
|
180
|
+
};
|
|
181
|
+
onRejectCallback: {
|
|
182
|
+
type: PropType<() => void>;
|
|
183
|
+
};
|
|
184
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
185
|
+
P: {};
|
|
186
|
+
B: {};
|
|
187
|
+
D: {};
|
|
188
|
+
C: {};
|
|
189
|
+
M: {};
|
|
190
|
+
Defaults: {};
|
|
191
|
+
}, Readonly<Partial< ExtractPropTypes<{
|
|
192
|
+
botId: NumberConstructor;
|
|
193
|
+
toPath: StringConstructor;
|
|
194
|
+
defaultLoad: BooleanConstructor;
|
|
195
|
+
getPopupContainer: {
|
|
196
|
+
type: PropType<() => HTMLElement | Element>;
|
|
197
|
+
};
|
|
198
|
+
onCallback: {
|
|
199
|
+
type: PropType<(user: Comps.TgUserData) => void>;
|
|
200
|
+
};
|
|
201
|
+
onRejectCallback: {
|
|
202
|
+
type: PropType<() => void>;
|
|
203
|
+
};
|
|
204
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
205
|
+
__isFragment?: never;
|
|
206
|
+
__isTeleport?: never;
|
|
207
|
+
__isSuspense?: never;
|
|
208
|
+
} & ComponentOptionsBase<Readonly<Partial< ExtractPropTypes<{
|
|
209
|
+
botId: NumberConstructor;
|
|
210
|
+
toPath: StringConstructor;
|
|
211
|
+
defaultLoad: BooleanConstructor;
|
|
212
|
+
getPopupContainer: {
|
|
213
|
+
type: PropType<() => HTMLElement | Element>;
|
|
214
|
+
};
|
|
215
|
+
onCallback: {
|
|
216
|
+
type: PropType<(user: Comps.TgUserData) => void>;
|
|
217
|
+
};
|
|
218
|
+
onRejectCallback: {
|
|
219
|
+
type: PropType<() => void>;
|
|
220
|
+
};
|
|
221
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
222
|
+
readonly toTelegramAuth: typeof Comps.toTelegramAuth;
|
|
223
|
+
readonly getTelegramAuthUrlParams: typeof Comps.getTelegramAuthUrlParams;
|
|
224
|
+
} & Plugin;
|
|
225
|
+
};
|
|
226
|
+
export default JKVUEComps;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import { VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
export * from './is';
|
|
3
|
+
export * from './math';
|
|
4
|
+
export * from './vuePropTypes';
|
|
5
|
+
export * from './timeZone';
|
|
6
|
+
export * from './withInstall';
|
|
7
|
+
/** 代替eval方法 */
|
|
8
|
+
export declare function evalPro(str: string): any;
|
|
9
|
+
/** 数字输入过滤
|
|
10
|
+
* @param eventVal 输入的值
|
|
11
|
+
* @param type 输入类型,int整数,float,default: 'int'
|
|
12
|
+
* @param maxDecimal 最大小数位,default: 6
|
|
13
|
+
*/
|
|
14
|
+
export declare function filterInputNum(eventVal: string | number, type?: 'int' | 'float', maxDecimal?: number): string;
|
|
15
|
+
/** 生成输入数字过滤函数
|
|
16
|
+
* @param obj 对象
|
|
17
|
+
* @param key 对象里面的字段名
|
|
18
|
+
* @param fn 输入过滤之后执行的函数
|
|
19
|
+
* @param type 输入类型,int整数,float,default: 'int'
|
|
20
|
+
* @param maxDecimal 最大小数位,default: 6
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateFilterInputNumFn<T extends Recordable, K extends keyof T>(obj: T, key: K, fn?: () => void, type?: 'float' | 'int', maxDecimal?: number): (e: ChangeEvent) => void;
|
|
23
|
+
/** 渲染Html字符串片段 */
|
|
24
|
+
export declare function renderHtmlStr(html: string): string | VNode<RendererNode, RendererElement, {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>;
|
|
27
|
+
/** 获取当前网站协议+域名 */
|
|
28
|
+
export declare function getWebsiteUrl(): string;
|
|
29
|
+
/** 获取路由参数 */
|
|
30
|
+
export declare function getRouterParams(): Recordable<any> | undefined;
|
|
31
|
+
/** 去除字符串里的所有空字符 */
|
|
32
|
+
export declare function removeWhitespace(str: any): string;
|
|
33
|
+
/** 深度合并 */
|
|
34
|
+
export declare function deepMerge<T = any>(src?: any, target?: any): T;
|
|
35
|
+
/** 字符串脱敏
|
|
36
|
+
* @param str 值
|
|
37
|
+
* @param number 可见的字符数,default: 6
|
|
38
|
+
* @param options = {
|
|
39
|
+
* showPrefix 显示前缀字符,default: true
|
|
40
|
+
* showSuffix 显示后缀字符,default: true
|
|
41
|
+
* middleStr 中间的字符串,default: '****'
|
|
42
|
+
* }
|
|
43
|
+
*/
|
|
44
|
+
export declare function desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
|
|
45
|
+
showPrefix?: boolean;
|
|
46
|
+
showSuffix?: boolean;
|
|
47
|
+
middleStr?: string;
|
|
48
|
+
}): string | undefined;
|
|
49
|
+
/** 数字转为样式单位
|
|
50
|
+
* @param str 值
|
|
51
|
+
* @param unit 单位,default: 'px'
|
|
52
|
+
*/
|
|
53
|
+
export declare function toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
|
|
54
|
+
/** 数字转为样式对象 */
|
|
55
|
+
export declare function toStyleObject(style?: string | Recordable | null): Recordable<any>;
|
package/dist/utils/is.d.ts
CHANGED
|
@@ -1 +1,59 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function is(val: unknown, type: string): boolean;
|
|
2
|
+
/** 是否undefined */
|
|
3
|
+
export declare function isDef<T = unknown>(val?: T): val is T;
|
|
4
|
+
/** 是否不是undefined */
|
|
5
|
+
export declare function isUnDef<T = unknown>(val?: T): val is T;
|
|
6
|
+
/** 是否对象 */
|
|
7
|
+
export declare function isObject(val: any): val is Record<any, any>;
|
|
8
|
+
/** 是否Date */
|
|
9
|
+
export declare function isDate(val: unknown): val is Date;
|
|
10
|
+
/** 是否null */
|
|
11
|
+
export declare function isNull(val: unknown): val is null;
|
|
12
|
+
/** 是否null && 不是undefined */
|
|
13
|
+
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
14
|
+
/** 是否null || 不是undefined */
|
|
15
|
+
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
16
|
+
/** 是否数字(NaN也是数字) */
|
|
17
|
+
export declare function isNumber(val: unknown): val is number;
|
|
18
|
+
/** 是否字符串 */
|
|
19
|
+
export declare function isString(val: unknown): val is string;
|
|
20
|
+
/** 是否函数 */
|
|
21
|
+
export declare function isFunction(val: unknown): val is (...args: any[]) => any;
|
|
22
|
+
/** 是否布尔 */
|
|
23
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
24
|
+
/** 是否正则 */
|
|
25
|
+
export declare function isRegExp(val: unknown): val is RegExp;
|
|
26
|
+
/** 是否数组 */
|
|
27
|
+
export declare function isArray(val: any): val is Array<any>;
|
|
28
|
+
/** 是否空 */
|
|
29
|
+
export declare function isEmpty<T = unknown>(val: T): val is T;
|
|
30
|
+
/** 是否Promise */
|
|
31
|
+
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
32
|
+
/** 是否PromiseLink */
|
|
33
|
+
export declare function isPromiseLink<T>(it: T | PromiseLike<T>): it is PromiseLike<T>;
|
|
34
|
+
/** 是否Window */
|
|
35
|
+
export declare function isWindow(val: any): val is Window;
|
|
36
|
+
/** 是否Element */
|
|
37
|
+
export declare function isElement(val: unknown): val is Element;
|
|
38
|
+
/** 是否Map */
|
|
39
|
+
export declare function isMap(val: unknown): val is Map<any, any>;
|
|
40
|
+
/** 是否服务端渲染,没有window对象 */
|
|
41
|
+
export declare function isServer(): boolean;
|
|
42
|
+
/** 是否客户端,window对象不为undefined */
|
|
43
|
+
export declare function isClient(): boolean;
|
|
44
|
+
/** 是否url */
|
|
45
|
+
export declare function isUrl(path: string): boolean;
|
|
46
|
+
/** 是否Ip */
|
|
47
|
+
export declare function isIp(ip: string): boolean;
|
|
48
|
+
/** 是否邮箱 */
|
|
49
|
+
export declare function isEmail(v: any): boolean;
|
|
50
|
+
/** 是否号码 */
|
|
51
|
+
export declare function isValidPhoneNumber(phoneNumber: string): boolean;
|
|
52
|
+
/** 是否移动端浏览器 */
|
|
53
|
+
export declare function isInMobileBrowser(): false | RegExpMatchArray | null;
|
|
54
|
+
/** 是否中文 */
|
|
55
|
+
export declare function isZhLang(lang: string): boolean;
|
|
56
|
+
/** 是否Edge浏览器 */
|
|
57
|
+
export declare function isEdgeBrowser(): boolean;
|
|
58
|
+
/** 是否html字符串 */
|
|
59
|
+
export declare function isHtmlStr(str: string): boolean;
|
package/dist/utils/lodash.d.ts
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
/** 代替lodash.clone */
|
|
2
|
+
export declare function clone<T>(value: T): T;
|
|
3
|
+
/** 深拷贝 */
|
|
4
|
+
export declare function cloneDeep<T>(target: T, map?: WeakMap<object, any>): T;
|
|
5
|
+
/** 代替lodash.pick */
|
|
6
|
+
export declare function pick<T extends object, K extends keyof T>(obj: T | null | undefined, keys: K | K[]): Pick<T, K>;
|
|
7
|
+
/** 代替lodash.pickBy */
|
|
8
|
+
export declare function pickBy<T extends object, S extends T[keyof T]>(obj: T | null | undefined, predicate: (value: T[keyof T], key: keyof T) => value is S): {
|
|
9
|
+
[K in keyof T]?: S;
|
|
10
|
+
};
|
|
11
|
+
export declare function pickBy<T extends object>(obj: T | null | undefined, predicate: (value: T[keyof T], key: keyof T) => any): Partial<T>;
|
|
12
|
+
/** 代替lodash.omit */
|
|
13
|
+
export declare function omit<T extends object, K extends keyof T = keyof T>(obj: T, keys: K | K[]): Omit<T, K>;
|
|
14
|
+
export declare function omit<T extends object>(obj: T): T;
|
|
15
|
+
export declare function omit<T extends null | undefined>(obj: T, keys?: any): T;
|
|
16
|
+
export declare function omit<T extends string | number | boolean | symbol>(obj: T, keys?: any): T;
|
|
17
|
+
type GetPathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? GetPathValue<Exclude<T[Key], undefined | null>, Rest> : undefined : P extends keyof T ? T[P] : undefined;
|
|
18
|
+
/** 代替lodash.get */
|
|
19
|
+
export declare function get<T extends object, P extends string>(obj: T, path: P): GetPathValue<T, P>;
|
|
20
|
+
export declare function get<T extends object, P extends string, D>(obj: T, path: P, defaultValue: D): Exclude<GetPathValue<T, P>, undefined> | D;
|
|
21
|
+
/** 代替lodash.set */
|
|
22
|
+
export declare function set<T>(obj: T, path: string | number, value: any): T;
|
|
23
|
+
/** 代替lodash.isNil */
|
|
24
|
+
export declare function isNil(value: any): value is null | undefined;
|
|
25
|
+
/** 代替lodash.isEqual */
|
|
26
|
+
export declare function isEqual(value: any, other: any): boolean;
|
|
27
|
+
/** 代替lodash.uniq */
|
|
28
|
+
export declare function uniq<T>(array: T[] | null | undefined): T[];
|
|
29
|
+
/** 代替lodash.uniqBy */
|
|
30
|
+
export declare function uniqBy<T>(array: T[] | null | undefined, iteratee: ((item: T) => any) | keyof T): T[];
|
|
31
|
+
/** 代替lodash.upperFirst */
|
|
32
|
+
export declare function upperFirst(str: string | null | undefined): string;
|
|
33
|
+
/** 代替lodash.merge */
|
|
34
|
+
export declare function merge<T extends object, S extends object[]>(target: T, ...sources: S): T & any;
|
|
35
|
+
/** 代替lodash.difference */
|
|
36
|
+
export declare function difference<T>(array: T[] | null | undefined, ...values: T[][]): T[];
|
|
37
|
+
/** 代替lodash.intersection */
|
|
38
|
+
export declare function intersection<T>(...arrays: T[][]): T[];
|
|
39
|
+
export {};
|