jk-vue-comps 0.2.1 → 0.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/chunks/{index-DiBTCIdi.js → index-CAW2nf5W.js} +32 -33
- package/dist/components/GoogleAuth.js +60 -68
- package/dist/components/TelegramAuth.js +55 -63
- package/dist/hooks/useFormKeypressEnter.js +5 -5
- package/dist/index.js +2 -2
- package/dist/utils/index.js +1 -1
- package/dist/utils/is.js +81 -83
- package/dist/utils/math.js +7 -7
- package/dist/utils/vuePropTypes.js +21 -19
- package/package.json +15 -15
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createVNode as N } from "vue";
|
|
2
|
-
import { isString as l, isHtmlStr as p, isObject as
|
|
3
|
-
import { toNum as g, isNanValue as d, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, formatRate as K, helper as Q, isBigNum as X, isBool as Y, isEqualTo as ee, isGreaterThan as ie, isGreaterThanOrEqualTo as te, isInt as ne, isLessThan as re, isLessThanOrEqualTo as oe, isNum as se, multiply as ue, power as ae, subtract as le, toBigNum as
|
|
2
|
+
import { isString as l, isHtmlStr as p, isObject as c, isNumber as m, 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 D, isNullAndUnDef as q, 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 g, isNanValue as d, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, formatRate as K, helper as Q, isBigNum as X, isBool as Y, isEqualTo as ee, isGreaterThan as ie, isGreaterThanOrEqualTo as te, isInt as ne, isLessThan as re, isLessThanOrEqualTo as oe, isNum as se, multiply as ue, power as ae, subtract as le, toBigNum as fe, toDecimalPlaces as ce, toInt as pe, toLocaleString as me, toString as ge, unFormatRate as de } from "../utils/math.js";
|
|
4
4
|
import { propTypes as he } from "../utils/vuePropTypes.js";
|
|
5
5
|
import { timeZoneOptions as we } from "../utils/timeZone.js";
|
|
6
6
|
import { withInstall as Ne } from "../utils/withInstall.js";
|
|
7
|
-
function
|
|
7
|
+
function f(e) {
|
|
8
8
|
try {
|
|
9
9
|
return new Function(`'use strict'; return (${e});`)();
|
|
10
10
|
} catch {
|
|
@@ -14,22 +14,21 @@ function c(e) {
|
|
|
14
14
|
function h(e, t = "float", n = 6) {
|
|
15
15
|
let i = String(e);
|
|
16
16
|
if (i = i.replace(/(^\s*)|(\s*$)/g, ""), i !== "") {
|
|
17
|
-
const
|
|
18
|
-
if (i = i.replace(r, ""),
|
|
17
|
+
const o = i.indexOf("0") === 0 && i.length > 1 && i.indexOf(".") !== 1, r = t === "int" ? /[^\d]/g : /[^\d.]/g;
|
|
18
|
+
if (i = i.replace(r, ""), o)
|
|
19
19
|
return "0";
|
|
20
20
|
if (t === "int")
|
|
21
21
|
i = i.indexOf("0") === 0 && i.length > 1 ? i.substring(0, i.length - 1) : i;
|
|
22
22
|
else {
|
|
23
|
-
const
|
|
24
|
-
i.indexOf(".") === 0 ? (i = "", i = i.replace(/[^$#$]/g, "0."), i = i.replace(
|
|
23
|
+
const s = f(`/\\.{${n},}/g`), u = f(`/^(\\d?)+(\\.\\d{0,${n}})?$/`);
|
|
24
|
+
i.indexOf(".") === 0 ? (i = "", i = i.replace(/[^$#$]/g, "0."), i = i.replace(s, ".")) : u.test(i) || (i = i.substring(0, i.length - 1));
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
return i;
|
|
28
28
|
}
|
|
29
|
-
function Se(e, t, n, i = "int",
|
|
29
|
+
function Se(e, t, n, i = "int", o = 6) {
|
|
30
30
|
return (r) => {
|
|
31
|
-
|
|
32
|
-
e[t] = h((o = r == null ? void 0 : r.target) == null ? void 0 : o.value, i, s), n == null || n();
|
|
31
|
+
e[t] = h(r?.target?.value, i, o), n?.();
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
function $e(e) {
|
|
@@ -38,7 +37,7 @@ function $e(e) {
|
|
|
38
37
|
function be() {
|
|
39
38
|
return window ? `${window.location.protocol}//${window.location.hostname}` : "";
|
|
40
39
|
}
|
|
41
|
-
function
|
|
40
|
+
function ve() {
|
|
42
41
|
const e = new URLSearchParams(window.location.search);
|
|
43
42
|
if (!e.size)
|
|
44
43
|
return;
|
|
@@ -47,34 +46,34 @@ function Oe() {
|
|
|
47
46
|
t[n] = i;
|
|
48
47
|
return t;
|
|
49
48
|
}
|
|
50
|
-
function
|
|
49
|
+
function Oe(e) {
|
|
51
50
|
return l(e) ? e.replace(/\s+/g, "") : "";
|
|
52
51
|
}
|
|
53
52
|
function w(e = {}, t = {}) {
|
|
54
53
|
let n;
|
|
55
54
|
for (n in t)
|
|
56
|
-
e[n] =
|
|
55
|
+
e[n] = c(e[n]) ? w(e[n], t[n]) : e[n] = t[n];
|
|
57
56
|
return e;
|
|
58
57
|
}
|
|
59
|
-
function Ue(e, t = 6, { showPrefix: n = !0, showSuffix: i = !0, middleStr:
|
|
58
|
+
function Ue(e, t = 6, { showPrefix: n = !0, showSuffix: i = !0, middleStr: o = "****" } = {}) {
|
|
60
59
|
if (!l(e) && !m(e))
|
|
61
60
|
return e;
|
|
62
|
-
const r = String(e),
|
|
63
|
-
if (!r || !
|
|
61
|
+
const r = String(e), s = r?.length ?? 0;
|
|
62
|
+
if (!r || !s || t <= 0)
|
|
64
63
|
return r;
|
|
65
|
-
const u = n ? r.substring(0, t) : "", a = i ? r.substring(
|
|
66
|
-
return `${u}${
|
|
64
|
+
const u = n ? r.substring(0, t) : "", a = i ? r.substring(s - t) : "";
|
|
65
|
+
return `${u}${o}${a}`;
|
|
67
66
|
}
|
|
68
67
|
function Te(e, t = "px") {
|
|
69
68
|
if (!(e === null || e === "" || e === void 0))
|
|
70
69
|
return d(e) ? String(e) : `${g(e)}${t}`;
|
|
71
70
|
}
|
|
72
71
|
function ye(e) {
|
|
73
|
-
return e ?
|
|
74
|
-
const [i,
|
|
72
|
+
return e ? c(e) ? e : e.split(";").reduce((t, n) => {
|
|
73
|
+
const [i, o] = n.trim().split(":");
|
|
75
74
|
if (i) {
|
|
76
|
-
const
|
|
77
|
-
t[
|
|
75
|
+
const s = i.trim().replace(/-(\w)/g, (u, a) => a ? a.toUpperCase() : "");
|
|
76
|
+
t[s] = o.trim();
|
|
78
77
|
}
|
|
79
78
|
return t;
|
|
80
79
|
}, {}) : {};
|
|
@@ -88,11 +87,11 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
88
87
|
deepMerge: w,
|
|
89
88
|
desensitization: Ue,
|
|
90
89
|
divide: J,
|
|
91
|
-
evalPro:
|
|
90
|
+
evalPro: f,
|
|
92
91
|
filterInputNum: h,
|
|
93
92
|
formatRate: K,
|
|
94
93
|
generateFilterInputNumFn: Se,
|
|
95
|
-
getRouterParams:
|
|
94
|
+
getRouterParams: ve,
|
|
96
95
|
getWebsiteUrl: be,
|
|
97
96
|
helper: Q,
|
|
98
97
|
is: S,
|
|
@@ -100,8 +99,8 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
100
99
|
isBigNum: X,
|
|
101
100
|
isBool: Y,
|
|
102
101
|
isBoolean: b,
|
|
103
|
-
isClient:
|
|
104
|
-
isDate:
|
|
102
|
+
isClient: v,
|
|
103
|
+
isDate: O,
|
|
105
104
|
isDef: U,
|
|
106
105
|
isEdgeBrowser: T,
|
|
107
106
|
isElement: y,
|
|
@@ -124,7 +123,7 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
124
123
|
isNullOrUnDef: F,
|
|
125
124
|
isNum: se,
|
|
126
125
|
isNumber: m,
|
|
127
|
-
isObject:
|
|
126
|
+
isObject: c,
|
|
128
127
|
isPromise: M,
|
|
129
128
|
isPromiseLink: R,
|
|
130
129
|
isRegExp: _,
|
|
@@ -138,12 +137,12 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
138
137
|
multiply: ue,
|
|
139
138
|
power: ae,
|
|
140
139
|
propTypes: he,
|
|
141
|
-
removeWhitespace:
|
|
140
|
+
removeWhitespace: Oe,
|
|
142
141
|
renderHtmlStr: $e,
|
|
143
142
|
subtract: le,
|
|
144
143
|
timeZoneOptions: we,
|
|
145
|
-
toBigNum:
|
|
146
|
-
toDecimalPlaces:
|
|
144
|
+
toBigNum: fe,
|
|
145
|
+
toDecimalPlaces: ce,
|
|
147
146
|
toInt: pe,
|
|
148
147
|
toLocaleString: me,
|
|
149
148
|
toNum: g,
|
|
@@ -156,10 +155,10 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
156
155
|
export {
|
|
157
156
|
De as U,
|
|
158
157
|
be as a,
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
ve as b,
|
|
159
|
+
Oe as c,
|
|
161
160
|
w as d,
|
|
162
|
-
|
|
161
|
+
f as e,
|
|
163
162
|
h as f,
|
|
164
163
|
Se as g,
|
|
165
164
|
Ue as h,
|
|
@@ -1,99 +1,91 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isInMobileBrowser as
|
|
1
|
+
import { defineComponent as m, computed as g, onMounted as C, createVNode as h } from "vue";
|
|
2
|
+
import { isInMobileBrowser as u } from "../utils/is.js";
|
|
3
3
|
import "../utils/math.js";
|
|
4
|
-
import { propTypes as
|
|
5
|
-
import { withInstall as
|
|
6
|
-
function
|
|
7
|
-
if (!
|
|
8
|
-
const
|
|
9
|
-
window.location.href =
|
|
4
|
+
import { propTypes as r } from "../utils/vuePropTypes.js";
|
|
5
|
+
import { withInstall as b } from "../utils/withInstall.js";
|
|
6
|
+
function d(o, c) {
|
|
7
|
+
if (!o || !c) return;
|
|
8
|
+
const l = encodeURIComponent(c), s = encodeURIComponent("email profile"), n = encodeURIComponent(o), a = `https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=${l}&scope=${s}&client_id=${n}`;
|
|
9
|
+
window.location.href = a;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
clientId:
|
|
13
|
-
redirectUri:
|
|
14
|
-
defaultLoad:
|
|
15
|
-
getPopupContainer:
|
|
16
|
-
onCallback:
|
|
17
|
-
onRejectCallback:
|
|
18
|
-
},
|
|
11
|
+
const _ = {
|
|
12
|
+
clientId: r.string,
|
|
13
|
+
redirectUri: r.string,
|
|
14
|
+
defaultLoad: r.bool,
|
|
15
|
+
getPopupContainer: r.funcType(),
|
|
16
|
+
onCallback: r.funcType(),
|
|
17
|
+
onRejectCallback: r.funcType()
|
|
18
|
+
}, w = /* @__PURE__ */ m({
|
|
19
19
|
name: "GoogleAuth",
|
|
20
|
-
toGoogleAuth:
|
|
21
|
-
props:
|
|
20
|
+
toGoogleAuth: d,
|
|
21
|
+
props: _,
|
|
22
22
|
slots: Object,
|
|
23
|
-
setup(
|
|
24
|
-
slots:
|
|
25
|
-
expose:
|
|
23
|
+
setup(o, {
|
|
24
|
+
slots: c,
|
|
25
|
+
expose: l
|
|
26
26
|
}) {
|
|
27
|
-
const
|
|
28
|
-
id:
|
|
29
|
-
uri:
|
|
27
|
+
const s = g(() => ({
|
|
28
|
+
id: o.clientId,
|
|
29
|
+
uri: o.redirectUri
|
|
30
30
|
}));
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
return (n = (e = (o = window == null ? void 0 : window.google) == null ? void 0 : o.accounts) == null ? void 0 : e.oauth2) == null ? void 0 : n.initCodeClient;
|
|
31
|
+
function n() {
|
|
32
|
+
return window?.google?.accounts?.oauth2?.initCodeClient;
|
|
34
33
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
return ((e = t.getPopupContainer) == null ? void 0 : e.call(t)) || document.body;
|
|
34
|
+
function a() {
|
|
35
|
+
return o.getPopupContainer?.() || document.body;
|
|
38
36
|
}
|
|
39
|
-
function
|
|
40
|
-
return new Promise((
|
|
41
|
-
var n, c;
|
|
37
|
+
function p() {
|
|
38
|
+
return new Promise((t) => {
|
|
42
39
|
if (!document) {
|
|
43
|
-
|
|
40
|
+
t(!1);
|
|
44
41
|
return;
|
|
45
42
|
}
|
|
46
|
-
if (
|
|
47
|
-
|
|
43
|
+
if (u() || n()) {
|
|
44
|
+
t(!0);
|
|
48
45
|
return;
|
|
49
46
|
}
|
|
50
47
|
const e = document.createElement("script");
|
|
51
|
-
e.async = !0, e.defer = !0, e.src = "https://accounts.google.com/gsi/client", (
|
|
52
|
-
|
|
48
|
+
e.async = !0, e.defer = !0, e.src = "https://accounts.google.com/gsi/client", a()?.appendChild?.(e), e.onload = () => {
|
|
49
|
+
t(!!n());
|
|
53
50
|
}, e.onerror = () => {
|
|
54
|
-
e.remove(),
|
|
51
|
+
e.remove(), t(!1);
|
|
55
52
|
};
|
|
56
53
|
});
|
|
57
54
|
}
|
|
58
|
-
async function
|
|
59
|
-
var n, c, h;
|
|
55
|
+
async function f() {
|
|
60
56
|
const {
|
|
61
|
-
id:
|
|
57
|
+
id: t,
|
|
62
58
|
uri: e
|
|
63
|
-
} =
|
|
64
|
-
if (!
|
|
65
|
-
|
|
59
|
+
} = s.value;
|
|
60
|
+
if (!u() && !await p()) {
|
|
61
|
+
d(t || "", e || "");
|
|
66
62
|
return;
|
|
67
63
|
}
|
|
68
|
-
if (
|
|
69
|
-
|
|
64
|
+
if (u() || !n()) {
|
|
65
|
+
d(t || "", e || "");
|
|
70
66
|
return;
|
|
71
67
|
}
|
|
72
|
-
|
|
73
|
-
client_id:
|
|
68
|
+
n()?.({
|
|
69
|
+
client_id: t,
|
|
74
70
|
scope: "email profile",
|
|
75
71
|
redirect_uri: e,
|
|
76
|
-
ux_mode:
|
|
77
|
-
callback(
|
|
78
|
-
|
|
79
|
-
u != null && u.error ? (p = t.onRejectCallback) == null || p.call(t, u.error) : (b = t.onCallback) == null || b.call(t, u);
|
|
72
|
+
ux_mode: u() ? "redirect" : "popup",
|
|
73
|
+
callback(i) {
|
|
74
|
+
i?.error ? o.onRejectCallback?.(i.error) : o.onCallback?.(i);
|
|
80
75
|
}
|
|
81
|
-
})
|
|
76
|
+
})?.requestCode?.();
|
|
82
77
|
}
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
}),
|
|
86
|
-
startCheck:
|
|
87
|
-
}), () => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
startCheck: C
|
|
91
|
-
})]);
|
|
92
|
-
};
|
|
78
|
+
return C(() => {
|
|
79
|
+
o.defaultLoad && p();
|
|
80
|
+
}), l({
|
|
81
|
+
startCheck: f
|
|
82
|
+
}), () => h("div", null, [c.default?.({
|
|
83
|
+
startCheck: f
|
|
84
|
+
})]);
|
|
93
85
|
}
|
|
94
|
-
}),
|
|
86
|
+
}), T = b(w);
|
|
95
87
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
T as GoogleAuth,
|
|
89
|
+
T as default,
|
|
90
|
+
d as toGoogleAuth
|
|
99
91
|
};
|
|
@@ -1,112 +1,104 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
1
|
+
import { defineComponent as p, computed as g, onMounted as h, createVNode as b } from "vue";
|
|
2
|
+
import { a as w } from "../chunks/index-CAW2nf5W.js";
|
|
3
3
|
import { propTypes as l } from "../utils/vuePropTypes.js";
|
|
4
|
-
import { withInstall as
|
|
5
|
-
import { isInMobileBrowser as
|
|
6
|
-
function
|
|
7
|
-
if (!t || !
|
|
8
|
-
const c = encodeURIComponent(
|
|
9
|
-
window.location.href =
|
|
4
|
+
import { withInstall as C } from "../utils/withInstall.js";
|
|
5
|
+
import { isInMobileBrowser as i } from "../utils/is.js";
|
|
6
|
+
function s(t, a) {
|
|
7
|
+
if (!t || !a) return;
|
|
8
|
+
const c = encodeURIComponent(w()), r = encodeURIComponent(a), n = `https://oauth.telegram.org/auth?bot_id=${t}&origin=${c}&embed=1&request_access=write&return_to=${c}${r}`;
|
|
9
|
+
window.location.href = n;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function _() {
|
|
12
12
|
const t = /[#\?\&]tgAuthResult=([A-Za-z0-9\-_=]*)$/;
|
|
13
13
|
try {
|
|
14
|
-
const
|
|
14
|
+
const a = window.location.hash.toString(), c = a.match(t);
|
|
15
15
|
if (!c)
|
|
16
16
|
return null;
|
|
17
|
-
window.location.hash =
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
return
|
|
17
|
+
window.location.hash = a.replace(t, "");
|
|
18
|
+
let r = c[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
19
|
+
const n = r.length % 4;
|
|
20
|
+
return n > 1 && (r += new Array(5 - n).join("=")), r ? JSON.parse(window.atob(r)) : null;
|
|
21
21
|
} catch {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const T = {
|
|
26
26
|
botId: l.number,
|
|
27
27
|
toPath: l.string,
|
|
28
28
|
defaultLoad: l.bool,
|
|
29
29
|
getPopupContainer: l.funcType(),
|
|
30
30
|
onCallback: l.funcType(),
|
|
31
31
|
onRejectCallback: l.funcType()
|
|
32
|
-
},
|
|
32
|
+
}, y = /* @__PURE__ */ p({
|
|
33
33
|
name: "TelegramAuth",
|
|
34
|
-
toTelegramAuth:
|
|
35
|
-
getTelegramAuthUrlParams:
|
|
36
|
-
props:
|
|
34
|
+
toTelegramAuth: s,
|
|
35
|
+
getTelegramAuthUrlParams: _,
|
|
36
|
+
props: T,
|
|
37
37
|
slots: Object,
|
|
38
38
|
setup(t, {
|
|
39
|
-
slots:
|
|
39
|
+
slots: a,
|
|
40
40
|
expose: c
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
42
|
+
const r = g(() => ({
|
|
43
43
|
id: t.botId,
|
|
44
44
|
path: t.toPath
|
|
45
45
|
}));
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
return (e = (n = window == null ? void 0 : window.Telegram) == null ? void 0 : n.Login) == null ? void 0 : e.auth;
|
|
49
|
-
}
|
|
50
|
-
function b() {
|
|
51
|
-
var e;
|
|
52
|
-
return ((e = t.getPopupContainer) == null ? void 0 : e.call(t)) || document.body;
|
|
46
|
+
function n() {
|
|
47
|
+
return window?.Telegram?.Login?.auth;
|
|
53
48
|
}
|
|
54
49
|
function d() {
|
|
55
|
-
return
|
|
56
|
-
|
|
50
|
+
return t.getPopupContainer?.() || document.body;
|
|
51
|
+
}
|
|
52
|
+
function m() {
|
|
53
|
+
return new Promise((o) => {
|
|
57
54
|
if (!document) {
|
|
58
|
-
|
|
55
|
+
o(!1);
|
|
59
56
|
return;
|
|
60
57
|
}
|
|
61
|
-
if (
|
|
62
|
-
|
|
58
|
+
if (i() || n()) {
|
|
59
|
+
o(!0);
|
|
63
60
|
return;
|
|
64
61
|
}
|
|
65
62
|
const e = document.createElement("script");
|
|
66
|
-
e.async = !0, e.defer = !0, e.src = "https://telegram.org/js/telegram-widget.js", (
|
|
67
|
-
|
|
63
|
+
e.async = !0, e.defer = !0, e.src = "https://telegram.org/js/telegram-widget.js", d()?.appendChild?.(e), e.onload = () => {
|
|
64
|
+
o(!!n());
|
|
68
65
|
}, e.onerror = () => {
|
|
69
|
-
e.remove(),
|
|
66
|
+
e.remove(), o(!1);
|
|
70
67
|
};
|
|
71
68
|
});
|
|
72
69
|
}
|
|
73
|
-
async function
|
|
74
|
-
var u;
|
|
70
|
+
async function f() {
|
|
75
71
|
const {
|
|
76
|
-
id:
|
|
72
|
+
id: o,
|
|
77
73
|
path: e
|
|
78
|
-
} =
|
|
79
|
-
if (!
|
|
80
|
-
|
|
74
|
+
} = r.value;
|
|
75
|
+
if (!i() && !await m()) {
|
|
76
|
+
s(o || 0, e || "");
|
|
81
77
|
return;
|
|
82
78
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
79
|
+
if (i() || !n()) {
|
|
80
|
+
s(o || 0, e || "");
|
|
85
81
|
return;
|
|
86
82
|
}
|
|
87
|
-
(
|
|
88
|
-
bot_id:
|
|
83
|
+
n()?.({
|
|
84
|
+
bot_id: o,
|
|
89
85
|
request_access: !0
|
|
90
|
-
}, (
|
|
91
|
-
|
|
92
|
-
i ? (h = t.onCallback) == null || h.call(t, i) : (s = t.onRejectCallback) == null || s.call(t);
|
|
86
|
+
}, (u) => {
|
|
87
|
+
u ? t.onCallback?.(u) : t.onRejectCallback?.();
|
|
93
88
|
});
|
|
94
89
|
}
|
|
95
|
-
return
|
|
96
|
-
t.defaultLoad &&
|
|
90
|
+
return h(() => {
|
|
91
|
+
t.defaultLoad && m();
|
|
97
92
|
}), c({
|
|
98
|
-
startCheck:
|
|
99
|
-
}), () => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
startCheck: g
|
|
103
|
-
})]);
|
|
104
|
-
};
|
|
93
|
+
startCheck: f
|
|
94
|
+
}), () => b("div", null, [a.default?.({
|
|
95
|
+
startCheck: f
|
|
96
|
+
})]);
|
|
105
97
|
}
|
|
106
|
-
}),
|
|
98
|
+
}), I = C(y);
|
|
107
99
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
100
|
+
I as TelegramAuth,
|
|
101
|
+
I as default,
|
|
102
|
+
_ as getTelegramAuthUrlParams,
|
|
103
|
+
s as toTelegramAuth
|
|
112
104
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isFunction as e } from "../utils/is.js";
|
|
2
|
-
import { toValue as
|
|
3
|
-
function
|
|
2
|
+
import { toValue as n } from "vue";
|
|
3
|
+
function f(o, r) {
|
|
4
4
|
return function(...t) {
|
|
5
|
-
if (!(e(
|
|
6
|
-
return
|
|
5
|
+
if (!(e(r) ? r() : n(r)))
|
|
6
|
+
return o?.(...t);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
f as useFormKeypressEnter
|
|
11
11
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as e } from "./chunks/index-DyiqKziC.js";
|
|
2
2
|
import { H as s } from "./chunks/index-BXoUaF-m.js";
|
|
3
|
-
import { U as r } from "./chunks/index-
|
|
4
|
-
import { d as n, h as p, e as u, f, g, b as d, a as h, c as x, r as N, i as T, t as b } from "./chunks/index-
|
|
3
|
+
import { U as r } from "./chunks/index-CAW2nf5W.js";
|
|
4
|
+
import { d as n, h as p, e as u, f, g, b as d, a as h, c as x, r as N, i as T, t as b } from "./chunks/index-CAW2nf5W.js";
|
|
5
5
|
import { GoogleAuth as U, toGoogleAuth as E } from "./components/GoogleAuth.js";
|
|
6
6
|
import { TelegramAuth as P, getTelegramAuthUrlParams as S, toTelegramAuth as A } from "./components/TelegramAuth.js";
|
|
7
7
|
import { copyTextToClipboard as C, useCopyToClipboard as D } from "./hooks/useCopyToClipboard.js";
|
package/dist/utils/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { BigNumber as R, DOWN as W, UP as q, add as M, divide as j, formatRate a
|
|
|
4
4
|
import { propTypes as le } from "./vuePropTypes.js";
|
|
5
5
|
import { timeZoneOptions as ue } from "./timeZone.js";
|
|
6
6
|
import { withInstall as ge } from "./withInstall.js";
|
|
7
|
-
import { d as fe, h as de, e as he, f as be, g as ce, b as Ee, a as Se, c as Te, r as xe, i as Be, t as De } from "../chunks/index-
|
|
7
|
+
import { d as fe, h as de, e as he, f as be, g as ce, b as Ee, a as Se, c as Te, r as xe, i as Be, t as De } from "../chunks/index-CAW2nf5W.js";
|
|
8
8
|
export {
|
|
9
9
|
R as BigNumber,
|
|
10
10
|
W as DOWN,
|
package/dist/utils/is.js
CHANGED
|
@@ -1,132 +1,130 @@
|
|
|
1
|
-
function
|
|
2
|
-
return Object.prototype.toString.call(n) === `[object ${
|
|
1
|
+
function e(n, t) {
|
|
2
|
+
return Object.prototype.toString.call(n) === `[object ${t}]`;
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function d(n) {
|
|
5
5
|
return typeof n < "u";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return !
|
|
7
|
+
function s(n) {
|
|
8
|
+
return !d(n);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return n !== null &&
|
|
10
|
+
function o(n) {
|
|
11
|
+
return n !== null && e(n, "Object");
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function w(n) {
|
|
14
|
+
return e(n, "Date");
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function f(n) {
|
|
17
17
|
return n === null;
|
|
18
18
|
}
|
|
19
19
|
function l(n) {
|
|
20
|
-
return
|
|
20
|
+
return s(n) && f(n);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function m(n) {
|
|
23
|
+
return s(n) || f(n);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function b(n) {
|
|
26
|
+
return e(n, "Number");
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function c(n) {
|
|
29
|
+
return e(n, "String");
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function u(n) {
|
|
32
32
|
return typeof n == "function";
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function y(n) {
|
|
35
|
+
return e(n, "Boolean");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function A(n) {
|
|
38
|
+
return e(n, "RegExp");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function g(n) {
|
|
41
41
|
return n && Array.isArray(n);
|
|
42
42
|
}
|
|
43
|
+
function h(n) {
|
|
44
|
+
return g(n) || c(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : o(n) ? Object.keys(n).length === 0 : !1;
|
|
45
|
+
}
|
|
46
|
+
function E(n) {
|
|
47
|
+
return e(n, "Promise") && o(n) && u(n.then) && u(n.catch);
|
|
48
|
+
}
|
|
43
49
|
function N(n) {
|
|
44
|
-
return
|
|
50
|
+
return n instanceof Promise || typeof n?.then == "function";
|
|
45
51
|
}
|
|
46
52
|
function P(n) {
|
|
47
|
-
return
|
|
53
|
+
return typeof window < "u" && e(n, "Window");
|
|
48
54
|
}
|
|
49
55
|
function S(n) {
|
|
50
|
-
return
|
|
56
|
+
return o(n) && !!n.tagName;
|
|
51
57
|
}
|
|
52
58
|
function Z(n) {
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
function D(n) {
|
|
56
|
-
return u(n) && !!n.tagName;
|
|
59
|
+
return e(n, "Map");
|
|
57
60
|
}
|
|
58
|
-
function
|
|
59
|
-
return t(n, "Map");
|
|
60
|
-
}
|
|
61
|
-
function b() {
|
|
61
|
+
function p() {
|
|
62
62
|
return typeof window > "u";
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return !
|
|
64
|
+
function D() {
|
|
65
|
+
return !p();
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function M(n) {
|
|
68
68
|
return /^(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?(\/#\/)?(?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(n);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function O(n) {
|
|
71
71
|
return /\b(?:\d{1,3}.){3}\d{1,3}\b/.test(n);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function $(n) {
|
|
74
74
|
return /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
78
|
-
return !!(
|
|
76
|
+
function x(n) {
|
|
77
|
+
const t = /^1[3456789]\d{9}$/, r = /^(\d{3,4}-)?\d{7,8}$/;
|
|
78
|
+
return !!(t.test(n) || r.test(n));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function z() {
|
|
81
81
|
return typeof navigator < "u" && navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return r.some((o) => o === e) || !g.some((o) => o === e);
|
|
83
|
+
function B(n) {
|
|
84
|
+
const t = n?.replace(/\s+/g, "")?.toUpperCase?.(), r = ["ZH-CN", "ZH_CH", "ZH"], a = ["EN", "EN-US"];
|
|
85
|
+
return r.some((i) => i === t) || !a.some((i) => i === t);
|
|
87
86
|
}
|
|
88
|
-
function
|
|
89
|
-
var e;
|
|
87
|
+
function U() {
|
|
90
88
|
if (navigator.userAgent.indexOf("Edge") > -1)
|
|
91
89
|
return !0;
|
|
92
|
-
const n =
|
|
93
|
-
for (const
|
|
94
|
-
if (
|
|
90
|
+
const n = navigator?.userAgentData?.brands ?? [];
|
|
91
|
+
for (const t of n)
|
|
92
|
+
if (t?.brand === "Microsoft Edge")
|
|
95
93
|
return !0;
|
|
96
94
|
return !1;
|
|
97
95
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
96
|
+
function j(n) {
|
|
97
|
+
return c(n) && /<[^>]+>/g.test(n);
|
|
100
98
|
}
|
|
101
99
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
e as is,
|
|
101
|
+
g as isArray,
|
|
102
|
+
y as isBoolean,
|
|
103
|
+
D as isClient,
|
|
104
|
+
w as isDate,
|
|
105
|
+
d as isDef,
|
|
106
|
+
U as isEdgeBrowser,
|
|
107
|
+
S as isElement,
|
|
108
|
+
$ as isEmail,
|
|
109
|
+
h as isEmpty,
|
|
110
|
+
u as isFunction,
|
|
111
|
+
j as isHtmlStr,
|
|
112
|
+
z as isInMobileBrowser,
|
|
113
|
+
O as isIp,
|
|
114
|
+
Z as isMap,
|
|
115
|
+
f as isNull,
|
|
118
116
|
l as isNullAndUnDef,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
117
|
+
m as isNullOrUnDef,
|
|
118
|
+
b as isNumber,
|
|
119
|
+
o as isObject,
|
|
120
|
+
E as isPromise,
|
|
121
|
+
N as isPromiseLink,
|
|
122
|
+
A as isRegExp,
|
|
123
|
+
p as isServer,
|
|
124
|
+
c as isString,
|
|
125
|
+
s as isUnDef,
|
|
126
|
+
M as isUrl,
|
|
127
|
+
x as isValidPhoneNumber,
|
|
128
|
+
P as isWindow,
|
|
129
|
+
B as isZhLang
|
|
132
130
|
};
|
package/dist/utils/math.js
CHANGED
|
@@ -143,7 +143,7 @@ function Ee(a) {
|
|
|
143
143
|
return Ne(arguments, -1);
|
|
144
144
|
}, g.minimum = g.min = function() {
|
|
145
145
|
return Ne(arguments, 1);
|
|
146
|
-
}, g.random = function() {
|
|
146
|
+
}, g.random = (function() {
|
|
147
147
|
var e = 9007199254740992, r = Math.random() * e & 2097151 ? function() {
|
|
148
148
|
return $(Math.random() * e);
|
|
149
149
|
} : function() {
|
|
@@ -175,10 +175,10 @@ function Ee(a) {
|
|
|
175
175
|
}
|
|
176
176
|
return o.e = u, o.c = l, o;
|
|
177
177
|
};
|
|
178
|
-
}(), g.sum = function() {
|
|
178
|
+
})(), g.sum = function() {
|
|
179
179
|
for (var e = 1, r = arguments, n = new g(r[0]); e < r.length; ) n = n.plus(r[e++]);
|
|
180
180
|
return n;
|
|
181
|
-
}, d = /* @__PURE__ */ function() {
|
|
181
|
+
}, d = /* @__PURE__ */ (function() {
|
|
182
182
|
var e = "0123456789";
|
|
183
183
|
function r(n, s, t, u) {
|
|
184
184
|
for (var c, i = [0], f, l = 0, o = n.length; l < o; ) {
|
|
@@ -209,7 +209,7 @@ function Ee(a) {
|
|
|
209
209
|
}
|
|
210
210
|
return n;
|
|
211
211
|
};
|
|
212
|
-
}(), p = /* @__PURE__ */ function() {
|
|
212
|
+
})(), p = /* @__PURE__ */ (function() {
|
|
213
213
|
function e(s, t, u) {
|
|
214
214
|
var c, i, f, l, o = 0, h = s.length, N = t % Q, m = t / Q | 0;
|
|
215
215
|
for (s = s.slice(); h--; )
|
|
@@ -271,7 +271,7 @@ function Ee(a) {
|
|
|
271
271
|
D.e = l, D.r = +h;
|
|
272
272
|
return D;
|
|
273
273
|
};
|
|
274
|
-
}();
|
|
274
|
+
})();
|
|
275
275
|
function le(e, r, n, s) {
|
|
276
276
|
var t, u, c, i, f;
|
|
277
277
|
if (n == null ? n = R : B(n, 0, 8), !e.c) return e.toString();
|
|
@@ -296,7 +296,7 @@ function Ee(a) {
|
|
|
296
296
|
for (t = r[0]; t >= 10; t /= 10, s++) ;
|
|
297
297
|
return (n = s + n * E - 1) > H ? e.c = e.e = null : n < K ? e.c = [e.e = 0] : (e.e = n, e.c = r), e;
|
|
298
298
|
}
|
|
299
|
-
O = /* @__PURE__ */ function() {
|
|
299
|
+
O = /* @__PURE__ */ (function() {
|
|
300
300
|
var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, r = /^([^.]+)\.$/, n = /^\.([^.]+)$/, s = /^-?(Infinity|NaN)$/, t = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
301
301
|
return function(u, c, i, f) {
|
|
302
302
|
var l, o = i ? c : c.replace(t, "");
|
|
@@ -313,7 +313,7 @@ function Ee(a) {
|
|
|
313
313
|
}
|
|
314
314
|
u.c = u.e = null;
|
|
315
315
|
};
|
|
316
|
-
}();
|
|
316
|
+
})();
|
|
317
317
|
function q(e, r, n, s) {
|
|
318
318
|
var t, u, c, i, f, l, o, h = e.c, N = we;
|
|
319
319
|
if (h) {
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
number: t,
|
|
11
|
-
object: t,
|
|
12
|
-
integer: t
|
|
1
|
+
import * as t from "vue-types";
|
|
2
|
+
const { createTypes: a, toValidableType: s } = t, e = void 0;
|
|
3
|
+
class o extends a({
|
|
4
|
+
func: e,
|
|
5
|
+
bool: e,
|
|
6
|
+
string: e,
|
|
7
|
+
number: e,
|
|
8
|
+
object: e,
|
|
9
|
+
integer: e
|
|
13
10
|
}) {
|
|
11
|
+
static vueTypes = t;
|
|
12
|
+
static anyType = t.any;
|
|
13
|
+
static stringType = t.string;
|
|
14
|
+
static boolType = t.bool;
|
|
15
|
+
static numberType = t.number;
|
|
16
|
+
static funcType = t.func;
|
|
14
17
|
static get style() {
|
|
15
|
-
return
|
|
18
|
+
return s("style", {
|
|
16
19
|
type: [Object],
|
|
17
|
-
default:
|
|
20
|
+
default: e
|
|
18
21
|
});
|
|
19
22
|
}
|
|
20
23
|
static get vueNode() {
|
|
21
|
-
return
|
|
24
|
+
return s("vueNode", { default: e });
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
const b = c;
|
|
27
|
+
const n = o;
|
|
26
28
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
o as default,
|
|
30
|
+
n as propTypes
|
|
29
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jk-vue-comps",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "jk-vue-comps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,28 +27,28 @@
|
|
|
27
27
|
"check-types": "tsc --project tsconfig.json --noEmitOnError"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"vue": "3.5.
|
|
30
|
+
"vue": "3.5.21",
|
|
31
31
|
"vue-types": "^6.0.0",
|
|
32
32
|
"bignumber.js": "^9.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
36
|
-
"@types/node": "^
|
|
37
|
-
"@vitejs/plugin-vue": "
|
|
38
|
-
"@vitejs/plugin-vue-jsx": "
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
41
|
-
"eslint": "^9.
|
|
36
|
+
"@types/node": "^22.18.0",
|
|
37
|
+
"@vitejs/plugin-vue": "6.0.1",
|
|
38
|
+
"@vitejs/plugin-vue-jsx": "5.1.1",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
40
|
+
"@typescript-eslint/parser": "^8.43.0",
|
|
41
|
+
"eslint": "^9.35.0",
|
|
42
42
|
"eslint-config-prettier": "^10.1.8",
|
|
43
43
|
"eslint-plugin-import": "^2.32.0",
|
|
44
|
-
"eslint-plugin-prettier": "^5.5.
|
|
45
|
-
"eslint-plugin-vue": "^10.
|
|
46
|
-
"@eslint/js": "^9.
|
|
47
|
-
"globals": "^16.
|
|
44
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
45
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
46
|
+
"@eslint/js": "^9.35.0",
|
|
47
|
+
"globals": "^16.4.0",
|
|
48
48
|
"prettier": "^3.6.2",
|
|
49
49
|
"tslib": "^2.8.1",
|
|
50
|
-
"typescript": "
|
|
51
|
-
"vite": "
|
|
52
|
-
"vue-tsc": "^3.0.
|
|
50
|
+
"typescript": "5.9.2",
|
|
51
|
+
"vite": "7.1.5",
|
|
52
|
+
"vue-tsc": "^3.0.7"
|
|
53
53
|
}
|
|
54
54
|
}
|