jk-vue-comps 0.2.2 → 0.2.4
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/chunks/index-CHtnAuFs.js +174 -0
- package/dist/components/GoogleAuth.d.ts +55 -71
- package/dist/components/GoogleAuth.js +41 -35
- package/dist/components/TelegramAuth.d.ts +47 -55
- package/dist/components/TelegramAuth.js +45 -40
- package/dist/index.d.ts +80 -102
- package/dist/index.js +52 -46
- package/dist/utils/index.js +54 -48
- package/dist/utils/math.d.ts +6 -0
- package/dist/utils/math.js +213 -206
- package/dist/utils/vuePropTypes.d.ts +9 -51
- package/dist/utils/vuePropTypes.js +23 -21
- package/package.json +15 -15
- package/dist/chunks/index-CAW2nf5W.js +0 -168
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { createVNode as N } from "vue";
|
|
2
|
+
import { isString as l, isHtmlStr as p, isObject as c, isNumber as g, is as S, isArray as $, isBoolean as b, isClient as v, isDate as O, isDef as U, isEdgeBrowser as T, isElement as y, isEmail as P, isEmpty as x, isFunction as E, isInMobileBrowser as B, isIp as I, isMap as L, isNull as q, isNullAndUnDef as D, isNullOrUnDef as F, isPromise as M, isPromiseLink as R, isRegExp as _, isServer as k, isUnDef as W, isUrl as j, isValidPhoneNumber as z, isWindow as H, isZhLang as V } from "../utils/is.js";
|
|
3
|
+
import { toNum as m, isNanValue as d, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, eq as K, formatRate as Q, gt as X, gte as Y, helper as ee, isBigNum as te, isBool as ie, isEqualTo as ne, isGreaterThan as re, isGreaterThanOrEqualTo as oe, isInt as se, isLessThan as ue, isLessThanOrEqualTo as ae, isNan as le, isNum as fe, lt as ce, lte as pe, multiply as ge, power as me, subtract as de, toBigNum as he, toDecimalPlaces as we, toInt as Ne, toLocaleString as Se, toString as $e, unFormatRate as be } from "../utils/math.js";
|
|
4
|
+
import { propTypes as ve } from "../utils/vuePropTypes.js";
|
|
5
|
+
import { timeZoneOptions as Oe } from "../utils/timeZone.js";
|
|
6
|
+
import { withInstall as Ue } from "../utils/withInstall.js";
|
|
7
|
+
function f(e) {
|
|
8
|
+
try {
|
|
9
|
+
return new Function(`'use strict'; return (${e});`)();
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function h(e, i = "float", n = 6) {
|
|
15
|
+
let t = String(e);
|
|
16
|
+
if (t = t.replace(/(^\s*)|(\s*$)/g, ""), t !== "") {
|
|
17
|
+
const o = t.indexOf("0") === 0 && t.length > 1 && t.indexOf(".") !== 1, r = i === "int" ? /[^\d]/g : /[^\d.]/g;
|
|
18
|
+
if (t = t.replace(r, ""), o)
|
|
19
|
+
return "0";
|
|
20
|
+
if (i === "int")
|
|
21
|
+
t = t.indexOf("0") === 0 && t.length > 1 ? t.substring(0, t.length - 1) : t;
|
|
22
|
+
else {
|
|
23
|
+
const s = f(`/\\.{${n},}/g`), u = f(`/^(\\d?)+(\\.\\d{0,${n}})?$/`);
|
|
24
|
+
t.indexOf(".") === 0 ? (t = "", t = t.replace(/[^$#$]/g, "0."), t = t.replace(s, ".")) : u.test(t) || (t = t.substring(0, t.length - 1));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
function Te(e, i, n, t = "int", o = 6) {
|
|
30
|
+
return (r) => {
|
|
31
|
+
e[i] = h(r?.target?.value, t, o), n?.();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function ye(e) {
|
|
35
|
+
return !l(e) || !p(e) ? e : N("div", { innerHTML: e });
|
|
36
|
+
}
|
|
37
|
+
function Pe() {
|
|
38
|
+
return window ? `${window.location.protocol}//${window.location.hostname}` : "";
|
|
39
|
+
}
|
|
40
|
+
function xe() {
|
|
41
|
+
const e = new URLSearchParams(window.location.search);
|
|
42
|
+
if (!e.size)
|
|
43
|
+
return;
|
|
44
|
+
const i = {};
|
|
45
|
+
for (const [n, t] of e.entries())
|
|
46
|
+
i[n] = t;
|
|
47
|
+
return i;
|
|
48
|
+
}
|
|
49
|
+
function Ee(e) {
|
|
50
|
+
return l(e) ? e.replace(/\s+/g, "") : "";
|
|
51
|
+
}
|
|
52
|
+
function w(e = {}, i = {}) {
|
|
53
|
+
let n;
|
|
54
|
+
for (n in i)
|
|
55
|
+
e[n] = c(e[n]) ? w(e[n], i[n]) : e[n] = i[n];
|
|
56
|
+
return e;
|
|
57
|
+
}
|
|
58
|
+
function Be(e, i = 6, { showPrefix: n = !0, showSuffix: t = !0, middleStr: o = "****" } = {}) {
|
|
59
|
+
if (!l(e) && !g(e))
|
|
60
|
+
return e;
|
|
61
|
+
const r = String(e), s = r?.length ?? 0;
|
|
62
|
+
if (!r || !s || i <= 0)
|
|
63
|
+
return r;
|
|
64
|
+
const u = n ? r.substring(0, i) : "", a = t ? r.substring(s - i) : "";
|
|
65
|
+
return `${u}${o}${a}`;
|
|
66
|
+
}
|
|
67
|
+
function Ie(e, i = "px") {
|
|
68
|
+
if (!(e === null || e === "" || e === void 0))
|
|
69
|
+
return d(e) ? String(e) : `${m(e)}${i}`;
|
|
70
|
+
}
|
|
71
|
+
function Le(e) {
|
|
72
|
+
return e ? c(e) ? e : e.split(";").reduce((i, n) => {
|
|
73
|
+
const [t, o] = n.trim().split(":");
|
|
74
|
+
if (t) {
|
|
75
|
+
const s = t.trim().replace(/-(\w)/g, (u, a) => a ? a.toUpperCase() : "");
|
|
76
|
+
i[s] = o.trim();
|
|
77
|
+
}
|
|
78
|
+
return i;
|
|
79
|
+
}, {}) : {};
|
|
80
|
+
}
|
|
81
|
+
const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
82
|
+
__proto__: null,
|
|
83
|
+
BigNumber: A,
|
|
84
|
+
DOWN: C,
|
|
85
|
+
UP: G,
|
|
86
|
+
add: Z,
|
|
87
|
+
deepMerge: w,
|
|
88
|
+
desensitization: Be,
|
|
89
|
+
divide: J,
|
|
90
|
+
eq: K,
|
|
91
|
+
evalPro: f,
|
|
92
|
+
filterInputNum: h,
|
|
93
|
+
formatRate: Q,
|
|
94
|
+
generateFilterInputNumFn: Te,
|
|
95
|
+
getRouterParams: xe,
|
|
96
|
+
getWebsiteUrl: Pe,
|
|
97
|
+
gt: X,
|
|
98
|
+
gte: Y,
|
|
99
|
+
helper: ee,
|
|
100
|
+
is: S,
|
|
101
|
+
isArray: $,
|
|
102
|
+
isBigNum: te,
|
|
103
|
+
isBool: ie,
|
|
104
|
+
isBoolean: b,
|
|
105
|
+
isClient: v,
|
|
106
|
+
isDate: O,
|
|
107
|
+
isDef: U,
|
|
108
|
+
isEdgeBrowser: T,
|
|
109
|
+
isElement: y,
|
|
110
|
+
isEmail: P,
|
|
111
|
+
isEmpty: x,
|
|
112
|
+
isEqualTo: ne,
|
|
113
|
+
isFunction: E,
|
|
114
|
+
isGreaterThan: re,
|
|
115
|
+
isGreaterThanOrEqualTo: oe,
|
|
116
|
+
isHtmlStr: p,
|
|
117
|
+
isInMobileBrowser: B,
|
|
118
|
+
isInt: se,
|
|
119
|
+
isIp: I,
|
|
120
|
+
isLessThan: ue,
|
|
121
|
+
isLessThanOrEqualTo: ae,
|
|
122
|
+
isMap: L,
|
|
123
|
+
isNan: le,
|
|
124
|
+
isNanValue: d,
|
|
125
|
+
isNull: q,
|
|
126
|
+
isNullAndUnDef: D,
|
|
127
|
+
isNullOrUnDef: F,
|
|
128
|
+
isNum: fe,
|
|
129
|
+
isNumber: g,
|
|
130
|
+
isObject: c,
|
|
131
|
+
isPromise: M,
|
|
132
|
+
isPromiseLink: R,
|
|
133
|
+
isRegExp: _,
|
|
134
|
+
isServer: k,
|
|
135
|
+
isString: l,
|
|
136
|
+
isUnDef: W,
|
|
137
|
+
isUrl: j,
|
|
138
|
+
isValidPhoneNumber: z,
|
|
139
|
+
isWindow: H,
|
|
140
|
+
isZhLang: V,
|
|
141
|
+
lt: ce,
|
|
142
|
+
lte: pe,
|
|
143
|
+
multiply: ge,
|
|
144
|
+
power: me,
|
|
145
|
+
propTypes: ve,
|
|
146
|
+
removeWhitespace: Ee,
|
|
147
|
+
renderHtmlStr: ye,
|
|
148
|
+
subtract: de,
|
|
149
|
+
timeZoneOptions: Oe,
|
|
150
|
+
toBigNum: he,
|
|
151
|
+
toDecimalPlaces: we,
|
|
152
|
+
toInt: Ne,
|
|
153
|
+
toLocaleString: Se,
|
|
154
|
+
toNum: m,
|
|
155
|
+
toString: $e,
|
|
156
|
+
toStyleObject: Le,
|
|
157
|
+
toStyleUnit: Ie,
|
|
158
|
+
unFormatRate: be,
|
|
159
|
+
withInstall: Ue
|
|
160
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
161
|
+
export {
|
|
162
|
+
ke as U,
|
|
163
|
+
Pe as a,
|
|
164
|
+
xe as b,
|
|
165
|
+
Ee as c,
|
|
166
|
+
w as d,
|
|
167
|
+
f as e,
|
|
168
|
+
h as f,
|
|
169
|
+
Te as g,
|
|
170
|
+
Be as h,
|
|
171
|
+
Le as i,
|
|
172
|
+
ye as r,
|
|
173
|
+
Ie as t
|
|
174
|
+
};
|
|
@@ -1,99 +1,83 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
2
|
/** 跳转谷歌身份检查 */
|
|
3
3
|
export declare function toGoogleAuth(clientId: string, redirectUri: string): void;
|
|
4
|
+
type GetPopupContainerFn = () => HTMLElement | Element;
|
|
4
5
|
declare const _comp_props: {
|
|
5
|
-
clientId:
|
|
6
|
-
|
|
6
|
+
clientId: StringConstructor;
|
|
7
|
+
redirectUri: StringConstructor;
|
|
8
|
+
defaultLoad: BooleanConstructor;
|
|
9
|
+
getPopupContainer: {
|
|
10
|
+
type: PropType<GetPopupContainerFn>;
|
|
7
11
|
};
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
onCallback: {
|
|
13
|
+
type: PropType<(data: {
|
|
14
|
+
code: string;
|
|
15
|
+
}) => void>;
|
|
16
|
+
};
|
|
17
|
+
onRejectCallback: {
|
|
18
|
+
type: PropType<(error: any) => void>;
|
|
10
19
|
};
|
|
11
|
-
defaultLoad: import("vue-types").VueTypeValidableDef<boolean, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<boolean>>;
|
|
12
|
-
getPopupContainer: import("vue-types").VueTypeValidableDef<() => HTMLElement | Element, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => HTMLElement | Element>>;
|
|
13
|
-
onCallback: import("vue-types").VueTypeValidableDef<(data: {
|
|
14
|
-
code: string;
|
|
15
|
-
}) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(data: {
|
|
16
|
-
code: string;
|
|
17
|
-
}) => void>>;
|
|
18
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<(error: any) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(error: any) => void>>;
|
|
19
20
|
};
|
|
20
|
-
export type GoogleAuthProps = ExtractPropTypes<typeof _comp_props
|
|
21
|
+
export type GoogleAuthProps = Partial<ExtractPropTypes<typeof _comp_props>>;
|
|
21
22
|
/** 谷歌身份检查 */
|
|
22
23
|
export declare const GoogleAuth: {
|
|
23
|
-
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes<{
|
|
24
|
-
clientId:
|
|
25
|
-
|
|
24
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<Partial<ExtractPropTypes<{
|
|
25
|
+
clientId: StringConstructor;
|
|
26
|
+
redirectUri: StringConstructor;
|
|
27
|
+
defaultLoad: BooleanConstructor;
|
|
28
|
+
getPopupContainer: {
|
|
29
|
+
type: PropType<GetPopupContainerFn>;
|
|
26
30
|
};
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
onCallback: {
|
|
32
|
+
type: PropType<(data: {
|
|
33
|
+
code: string;
|
|
34
|
+
}) => void>;
|
|
29
35
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onCallback: import("vue-types").VueTypeValidableDef<(data: {
|
|
33
|
-
code: string;
|
|
34
|
-
}) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(data: {
|
|
35
|
-
code: string;
|
|
36
|
-
}) => void>>;
|
|
37
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<(error: any) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(error: any) => void>>;
|
|
38
|
-
}>> & Readonly<{}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
39
|
-
clientId: string;
|
|
40
|
-
redirectUri: string;
|
|
41
|
-
}, true, {}, SlotsType<{
|
|
42
|
-
default: {
|
|
43
|
-
startCheck: () => void;
|
|
36
|
+
onRejectCallback: {
|
|
37
|
+
type: PropType<(error: any) => void>;
|
|
44
38
|
};
|
|
45
|
-
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
39
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
46
40
|
P: {};
|
|
47
41
|
B: {};
|
|
48
42
|
D: {};
|
|
49
43
|
C: {};
|
|
50
44
|
M: {};
|
|
51
45
|
Defaults: {};
|
|
52
|
-
}, Readonly<ExtractPropTypes<{
|
|
53
|
-
clientId:
|
|
54
|
-
|
|
46
|
+
}, Readonly<Partial<ExtractPropTypes<{
|
|
47
|
+
clientId: StringConstructor;
|
|
48
|
+
redirectUri: StringConstructor;
|
|
49
|
+
defaultLoad: BooleanConstructor;
|
|
50
|
+
getPopupContainer: {
|
|
51
|
+
type: PropType<GetPopupContainerFn>;
|
|
55
52
|
};
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
onCallback: {
|
|
54
|
+
type: PropType<(data: {
|
|
55
|
+
code: string;
|
|
56
|
+
}) => void>;
|
|
58
57
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(data: {
|
|
64
|
-
code: string;
|
|
65
|
-
}) => void>>;
|
|
66
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<(error: any) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(error: any) => void>>;
|
|
67
|
-
}>> & Readonly<{}>, () => JSX.Element, {}, {}, {}, {
|
|
68
|
-
clientId: string;
|
|
69
|
-
redirectUri: string;
|
|
70
|
-
}>;
|
|
58
|
+
onRejectCallback: {
|
|
59
|
+
type: PropType<(error: any) => void>;
|
|
60
|
+
};
|
|
61
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
71
62
|
__isFragment?: never;
|
|
72
63
|
__isTeleport?: never;
|
|
73
64
|
__isSuspense?: never;
|
|
74
|
-
} & import("vue").ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
75
|
-
clientId:
|
|
76
|
-
|
|
65
|
+
} & import("vue").ComponentOptionsBase<Readonly<Partial<ExtractPropTypes<{
|
|
66
|
+
clientId: StringConstructor;
|
|
67
|
+
redirectUri: StringConstructor;
|
|
68
|
+
defaultLoad: BooleanConstructor;
|
|
69
|
+
getPopupContainer: {
|
|
70
|
+
type: PropType<GetPopupContainerFn>;
|
|
77
71
|
};
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
onCallback: {
|
|
73
|
+
type: PropType<(data: {
|
|
74
|
+
code: string;
|
|
75
|
+
}) => void>;
|
|
80
76
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onCallback: import("vue-types").VueTypeValidableDef<(data: {
|
|
84
|
-
code: string;
|
|
85
|
-
}) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(data: {
|
|
86
|
-
code: string;
|
|
87
|
-
}) => void>>;
|
|
88
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<(error: any) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(error: any) => void>>;
|
|
89
|
-
}>> & Readonly<{}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
90
|
-
clientId: string;
|
|
91
|
-
redirectUri: string;
|
|
92
|
-
}, {}, string, SlotsType<{
|
|
93
|
-
default: {
|
|
94
|
-
startCheck: () => void;
|
|
77
|
+
onRejectCallback: {
|
|
78
|
+
type: PropType<(error: any) => void>;
|
|
95
79
|
};
|
|
96
|
-
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
80
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
97
81
|
readonly toGoogleAuth: typeof toGoogleAuth;
|
|
98
82
|
} & import("vue").Plugin;
|
|
99
83
|
export default GoogleAuth;
|
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isInMobileBrowser as
|
|
1
|
+
import { defineComponent as f, computed as m, onMounted as g, createVNode as C } from "vue";
|
|
2
|
+
import { isInMobileBrowser as i } from "../utils/is.js";
|
|
3
3
|
import "../utils/math.js";
|
|
4
|
-
import
|
|
5
|
-
import { withInstall as
|
|
6
|
-
function d(o,
|
|
7
|
-
if (!o || !
|
|
8
|
-
const
|
|
4
|
+
import "../utils/vuePropTypes.js";
|
|
5
|
+
import { withInstall as h } from "../utils/withInstall.js";
|
|
6
|
+
function d(o, r) {
|
|
7
|
+
if (!o || !r) return;
|
|
8
|
+
const u = encodeURIComponent(r), l = encodeURIComponent("email profile"), n = encodeURIComponent(o), a = `https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=${u}&scope=${l}&client_id=${n}`;
|
|
9
9
|
window.location.href = a;
|
|
10
10
|
}
|
|
11
11
|
const _ = {
|
|
12
|
-
clientId:
|
|
13
|
-
redirectUri:
|
|
14
|
-
defaultLoad:
|
|
15
|
-
getPopupContainer:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
clientId: String,
|
|
13
|
+
redirectUri: String,
|
|
14
|
+
defaultLoad: Boolean,
|
|
15
|
+
getPopupContainer: {
|
|
16
|
+
type: Function
|
|
17
|
+
},
|
|
18
|
+
onCallback: {
|
|
19
|
+
type: Function
|
|
20
|
+
},
|
|
21
|
+
onRejectCallback: {
|
|
22
|
+
type: Function
|
|
23
|
+
}
|
|
24
|
+
}, b = /* @__PURE__ */ f({
|
|
19
25
|
name: "GoogleAuth",
|
|
20
26
|
toGoogleAuth: d,
|
|
21
27
|
props: _,
|
|
22
28
|
slots: Object,
|
|
23
29
|
setup(o, {
|
|
24
|
-
slots:
|
|
25
|
-
expose:
|
|
30
|
+
slots: r,
|
|
31
|
+
expose: u
|
|
26
32
|
}) {
|
|
27
|
-
const
|
|
33
|
+
const l = m(() => ({
|
|
28
34
|
id: o.clientId,
|
|
29
35
|
uri: o.redirectUri
|
|
30
36
|
}));
|
|
@@ -34,13 +40,13 @@ const _ = {
|
|
|
34
40
|
function a() {
|
|
35
41
|
return o.getPopupContainer?.() || document.body;
|
|
36
42
|
}
|
|
37
|
-
function
|
|
43
|
+
function s() {
|
|
38
44
|
return new Promise((t) => {
|
|
39
45
|
if (!document) {
|
|
40
46
|
t(!1);
|
|
41
47
|
return;
|
|
42
48
|
}
|
|
43
|
-
if (
|
|
49
|
+
if (i() || n()) {
|
|
44
50
|
t(!0);
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
@@ -52,16 +58,16 @@ const _ = {
|
|
|
52
58
|
};
|
|
53
59
|
});
|
|
54
60
|
}
|
|
55
|
-
async function
|
|
61
|
+
async function p() {
|
|
56
62
|
const {
|
|
57
63
|
id: t,
|
|
58
64
|
uri: e
|
|
59
|
-
} =
|
|
60
|
-
if (!
|
|
65
|
+
} = l.value;
|
|
66
|
+
if (!i() && !await s()) {
|
|
61
67
|
d(t || "", e || "");
|
|
62
68
|
return;
|
|
63
69
|
}
|
|
64
|
-
if (
|
|
70
|
+
if (i() || !n()) {
|
|
65
71
|
d(t || "", e || "");
|
|
66
72
|
return;
|
|
67
73
|
}
|
|
@@ -69,23 +75,23 @@ const _ = {
|
|
|
69
75
|
client_id: t,
|
|
70
76
|
scope: "email profile",
|
|
71
77
|
redirect_uri: e,
|
|
72
|
-
ux_mode:
|
|
73
|
-
callback(
|
|
74
|
-
|
|
78
|
+
ux_mode: i() ? "redirect" : "popup",
|
|
79
|
+
callback(c) {
|
|
80
|
+
c?.error ? o.onRejectCallback?.(c.error) : o.onCallback?.(c);
|
|
75
81
|
}
|
|
76
82
|
})?.requestCode?.();
|
|
77
83
|
}
|
|
78
|
-
return
|
|
79
|
-
o.defaultLoad &&
|
|
80
|
-
}),
|
|
81
|
-
startCheck:
|
|
82
|
-
}), () =>
|
|
83
|
-
startCheck:
|
|
84
|
+
return g(() => {
|
|
85
|
+
o.defaultLoad && s();
|
|
86
|
+
}), u({
|
|
87
|
+
startCheck: p
|
|
88
|
+
}), () => C("div", null, [r.default?.({
|
|
89
|
+
startCheck: p
|
|
84
90
|
})]);
|
|
85
91
|
}
|
|
86
|
-
}),
|
|
92
|
+
}), F = h(b);
|
|
87
93
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
F as GoogleAuth,
|
|
95
|
+
F as default,
|
|
90
96
|
d as toGoogleAuth
|
|
91
97
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
2
|
/** 跳转Telegram身份检查 */
|
|
3
3
|
export declare function toTelegramAuth(botId: number, toPath: string): void;
|
|
4
4
|
/** 获取路由中的Telegram身份检查回调参数 */
|
|
@@ -13,83 +13,75 @@ export interface TgUserData {
|
|
|
13
13
|
photo_url: string;
|
|
14
14
|
username: string;
|
|
15
15
|
}
|
|
16
|
+
type GetPopupContainerFn = () => HTMLElement | Element;
|
|
16
17
|
declare const _comp_props: {
|
|
17
|
-
botId:
|
|
18
|
-
|
|
18
|
+
botId: NumberConstructor;
|
|
19
|
+
toPath: StringConstructor;
|
|
20
|
+
defaultLoad: BooleanConstructor;
|
|
21
|
+
getPopupContainer: {
|
|
22
|
+
type: PropType<GetPopupContainerFn>;
|
|
19
23
|
};
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
onCallback: {
|
|
25
|
+
type: PropType<(user: TgUserData) => void>;
|
|
26
|
+
};
|
|
27
|
+
onRejectCallback: {
|
|
28
|
+
type: PropType<() => void>;
|
|
22
29
|
};
|
|
23
|
-
defaultLoad: import("vue-types").VueTypeValidableDef<boolean, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<boolean>>;
|
|
24
|
-
getPopupContainer: import("vue-types").VueTypeValidableDef<() => HTMLElement | Element, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => HTMLElement | Element>>;
|
|
25
|
-
onCallback: import("vue-types").VueTypeValidableDef<(user: TgUserData) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(user: TgUserData) => void>>;
|
|
26
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<() => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => void>>;
|
|
27
30
|
};
|
|
28
|
-
export type TelegramAuthProps = ExtractPropTypes<typeof _comp_props
|
|
31
|
+
export type TelegramAuthProps = Partial<ExtractPropTypes<typeof _comp_props>>;
|
|
29
32
|
/** Telegram身份检查 */
|
|
30
33
|
export declare const TelegramAuth: {
|
|
31
|
-
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes<{
|
|
32
|
-
botId:
|
|
33
|
-
|
|
34
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<Partial<ExtractPropTypes<{
|
|
35
|
+
botId: NumberConstructor;
|
|
36
|
+
toPath: StringConstructor;
|
|
37
|
+
defaultLoad: BooleanConstructor;
|
|
38
|
+
getPopupContainer: {
|
|
39
|
+
type: PropType<GetPopupContainerFn>;
|
|
34
40
|
};
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
onCallback: {
|
|
42
|
+
type: PropType<(user: TgUserData) => void>;
|
|
37
43
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
onCallback: import("vue-types").VueTypeValidableDef<(user: TgUserData) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(user: TgUserData) => void>>;
|
|
41
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<() => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => void>>;
|
|
42
|
-
}>> & Readonly<{}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
43
|
-
botId: number;
|
|
44
|
-
toPath: string;
|
|
45
|
-
}, true, {}, SlotsType<{
|
|
46
|
-
default: {
|
|
47
|
-
startCheck: () => void;
|
|
44
|
+
onRejectCallback: {
|
|
45
|
+
type: PropType<() => void>;
|
|
48
46
|
};
|
|
49
|
-
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
47
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
50
48
|
P: {};
|
|
51
49
|
B: {};
|
|
52
50
|
D: {};
|
|
53
51
|
C: {};
|
|
54
52
|
M: {};
|
|
55
53
|
Defaults: {};
|
|
56
|
-
}, Readonly<ExtractPropTypes<{
|
|
57
|
-
botId:
|
|
58
|
-
|
|
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>;
|
|
59
63
|
};
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
onRejectCallback: {
|
|
65
|
+
type: PropType<() => void>;
|
|
62
66
|
};
|
|
63
|
-
|
|
64
|
-
getPopupContainer: import("vue-types").VueTypeValidableDef<() => HTMLElement | Element, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => HTMLElement | Element>>;
|
|
65
|
-
onCallback: import("vue-types").VueTypeValidableDef<(user: TgUserData) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(user: TgUserData) => void>>;
|
|
66
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<() => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => void>>;
|
|
67
|
-
}>> & Readonly<{}>, () => JSX.Element, {}, {}, {}, {
|
|
68
|
-
botId: number;
|
|
69
|
-
toPath: string;
|
|
70
|
-
}>;
|
|
67
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
71
68
|
__isFragment?: never;
|
|
72
69
|
__isTeleport?: never;
|
|
73
70
|
__isSuspense?: never;
|
|
74
|
-
} & import("vue").ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
75
|
-
botId:
|
|
76
|
-
|
|
71
|
+
} & import("vue").ComponentOptionsBase<Readonly<Partial<ExtractPropTypes<{
|
|
72
|
+
botId: NumberConstructor;
|
|
73
|
+
toPath: StringConstructor;
|
|
74
|
+
defaultLoad: BooleanConstructor;
|
|
75
|
+
getPopupContainer: {
|
|
76
|
+
type: PropType<GetPopupContainerFn>;
|
|
77
77
|
};
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
onCallback: {
|
|
79
|
+
type: PropType<(user: TgUserData) => void>;
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onCallback: import("vue-types").VueTypeValidableDef<(user: TgUserData) => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<(user: TgUserData) => void>>;
|
|
84
|
-
onRejectCallback: import("vue-types").VueTypeValidableDef<() => void, import("node_modules/vue-types/dist/shared/vue-types.d8e57a80.mjs").b<() => void>>;
|
|
85
|
-
}>> & Readonly<{}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
86
|
-
botId: number;
|
|
87
|
-
toPath: string;
|
|
88
|
-
}, {}, string, SlotsType<{
|
|
89
|
-
default: {
|
|
90
|
-
startCheck: () => void;
|
|
81
|
+
onRejectCallback: {
|
|
82
|
+
type: PropType<() => void>;
|
|
91
83
|
};
|
|
92
|
-
}>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
84
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
93
85
|
readonly toTelegramAuth: typeof toTelegramAuth;
|
|
94
86
|
readonly getTelegramAuthUrlParams: typeof getTelegramAuthUrlParams;
|
|
95
87
|
} & import("vue").Plugin;
|