jk-vue-comps 0.1.8 → 0.1.9
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-aaoImdl9.js +157 -0
- package/dist/components/TelegramAuth.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +52 -49
- package/dist/utils/index.js +63 -60
- package/dist/utils/math.d.ts +3 -0
- package/dist/utils/math.js +58 -55
- package/package.json +1 -1
- package/dist/chunks/index-BPap5bmS.js +0 -154
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { nextTick as p, createVNode as h } from "vue";
|
|
2
|
+
import { isString as u, isHtmlStr as l, isObject as f, isNumber as c, is as w, isArray as N, isBoolean as S, isClient as b, isDate as x, isDef as O, isEdgeBrowser as $, isElement as P, isEmail as T, isEmpty as v, isFunction as y, isInMobileBrowser as E, isIp as B, isMap as I, isNull as L, isNullAndUnDef as U, isNullOrUnDef as D, isPromise as q, isPromiseLink as F, isRegExp as M, isServer as R, isUnDef as k, isUrl as W, isValidPhoneNumber as _, isWindow as j, isZhLang as z } from "../utils/is.js";
|
|
3
|
+
import { BigNumber as H, DOWN as V, UP as A, add as G, divide as Z, formatRate as C, helper as J, isBigNum as K, isBool as Q, isEqualTo as X, isGreaterThan as Y, isGreaterThanOrEqualTo as ee, isInt as ie, isLessThan as te, isLessThanOrEqualTo as re, isNanValue as ne, isNum as se, multiply as oe, power as ue, subtract as ae, toBigNum as le, toDecimalPlaces as fe, toInt as ce, toLocaleString as me, toNum as ge, toString as de, unFormatRate as pe } from "../utils/math.js";
|
|
4
|
+
import { propTypes as he } from "../utils/vuePropTypes.js";
|
|
5
|
+
import { timeZoneOptions as we } from "../utils/timeZone.js";
|
|
6
|
+
import { withInstall as Ne } from "../utils/withInstall.js";
|
|
7
|
+
function a(i) {
|
|
8
|
+
try {
|
|
9
|
+
return new Function(`'use strict'; return (${i});`)();
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function m(i, r = "float", t = 6) {
|
|
15
|
+
let e = String(i);
|
|
16
|
+
if (e = e.replace(/(^\s*)|(\s*$)/g, ""), e !== "") {
|
|
17
|
+
const s = e.indexOf("0") === 0 && e.length > 1 && e.indexOf(".") !== 1, n = r === "int" ? /[^\d]/g : /[^\d.]/g;
|
|
18
|
+
if (e = e.replace(n, ""), s)
|
|
19
|
+
return "0";
|
|
20
|
+
if (r === "int")
|
|
21
|
+
e = e.indexOf("0") === 0 && e.length > 1 ? e.substring(0, e.length - 1) : e;
|
|
22
|
+
else {
|
|
23
|
+
const o = a(`/\\.{${t},}/g`), d = a(`/^(\\d?)+(\\.\\d{0,${t}})?$/`);
|
|
24
|
+
e.indexOf(".") === 0 ? (e = "", e = e.replace(/[^$#$]/g, "0."), e = e.replace(o, ".")) : d.test(e) || (e = e.substring(0, e.length - 1));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
function Se(i, r, t, e = "int", s = 6) {
|
|
30
|
+
return (n) => {
|
|
31
|
+
p().then(() => {
|
|
32
|
+
var o;
|
|
33
|
+
i[r] = m((o = n == null ? void 0 : n.target) == null ? void 0 : o.value, e, s), t == null || t();
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function be(i) {
|
|
38
|
+
return !u(i) || !l(i) ? i : h("div", { innerHTML: i });
|
|
39
|
+
}
|
|
40
|
+
function xe() {
|
|
41
|
+
return window ? `${window.location.protocol}//${window.location.hostname}` : "";
|
|
42
|
+
}
|
|
43
|
+
function Oe() {
|
|
44
|
+
const i = new URLSearchParams(window.location.search);
|
|
45
|
+
if (!i.size)
|
|
46
|
+
return;
|
|
47
|
+
const r = {};
|
|
48
|
+
for (const [t, e] of i.entries())
|
|
49
|
+
r[t] = e;
|
|
50
|
+
return r;
|
|
51
|
+
}
|
|
52
|
+
function $e(i) {
|
|
53
|
+
return u(i) ? i.replace(/\s+/g, "") : "";
|
|
54
|
+
}
|
|
55
|
+
function g(i = {}, r = {}) {
|
|
56
|
+
let t;
|
|
57
|
+
for (t in r)
|
|
58
|
+
i[t] = f(i[t]) ? g(i[t], r[t]) : i[t] = r[t];
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
function Pe(i, r = 6, t = {
|
|
62
|
+
showPrefix: !0,
|
|
63
|
+
showSuffix: !0,
|
|
64
|
+
middleStr: "****"
|
|
65
|
+
}) {
|
|
66
|
+
if (!u(i) && !c(i))
|
|
67
|
+
return i;
|
|
68
|
+
const e = String(i), s = (e == null ? void 0 : e.length) ?? 0;
|
|
69
|
+
if (!e || !s || r <= 0)
|
|
70
|
+
return e;
|
|
71
|
+
const n = t.showPrefix ? e.substring(0, r) : "", o = t.showSuffix ? e.substring(s - r) : "";
|
|
72
|
+
return `${n}${t.middleStr}${o}`;
|
|
73
|
+
}
|
|
74
|
+
const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
|
+
__proto__: null,
|
|
76
|
+
BigNumber: H,
|
|
77
|
+
DOWN: V,
|
|
78
|
+
UP: A,
|
|
79
|
+
add: G,
|
|
80
|
+
deepMerge: g,
|
|
81
|
+
desensitization: Pe,
|
|
82
|
+
divide: Z,
|
|
83
|
+
evalPro: a,
|
|
84
|
+
filterInputNum: m,
|
|
85
|
+
formatRate: C,
|
|
86
|
+
generateFilterInputNumFn: Se,
|
|
87
|
+
getRouterParams: Oe,
|
|
88
|
+
getWebsiteUrl: xe,
|
|
89
|
+
helper: J,
|
|
90
|
+
is: w,
|
|
91
|
+
isArray: N,
|
|
92
|
+
isBigNum: K,
|
|
93
|
+
isBool: Q,
|
|
94
|
+
isBoolean: S,
|
|
95
|
+
isClient: b,
|
|
96
|
+
isDate: x,
|
|
97
|
+
isDef: O,
|
|
98
|
+
isEdgeBrowser: $,
|
|
99
|
+
isElement: P,
|
|
100
|
+
isEmail: T,
|
|
101
|
+
isEmpty: v,
|
|
102
|
+
isEqualTo: X,
|
|
103
|
+
isFunction: y,
|
|
104
|
+
isGreaterThan: Y,
|
|
105
|
+
isGreaterThanOrEqualTo: ee,
|
|
106
|
+
isHtmlStr: l,
|
|
107
|
+
isInMobileBrowser: E,
|
|
108
|
+
isInt: ie,
|
|
109
|
+
isIp: B,
|
|
110
|
+
isLessThan: te,
|
|
111
|
+
isLessThanOrEqualTo: re,
|
|
112
|
+
isMap: I,
|
|
113
|
+
isNanValue: ne,
|
|
114
|
+
isNull: L,
|
|
115
|
+
isNullAndUnDef: U,
|
|
116
|
+
isNullOrUnDef: D,
|
|
117
|
+
isNum: se,
|
|
118
|
+
isNumber: c,
|
|
119
|
+
isObject: f,
|
|
120
|
+
isPromise: q,
|
|
121
|
+
isPromiseLink: F,
|
|
122
|
+
isRegExp: M,
|
|
123
|
+
isServer: R,
|
|
124
|
+
isString: u,
|
|
125
|
+
isUnDef: k,
|
|
126
|
+
isUrl: W,
|
|
127
|
+
isValidPhoneNumber: _,
|
|
128
|
+
isWindow: j,
|
|
129
|
+
isZhLang: z,
|
|
130
|
+
multiply: oe,
|
|
131
|
+
power: ue,
|
|
132
|
+
propTypes: he,
|
|
133
|
+
removeWhitespace: $e,
|
|
134
|
+
renderHtmlStr: be,
|
|
135
|
+
subtract: ae,
|
|
136
|
+
timeZoneOptions: we,
|
|
137
|
+
toBigNum: le,
|
|
138
|
+
toDecimalPlaces: fe,
|
|
139
|
+
toInt: ce,
|
|
140
|
+
toLocaleString: me,
|
|
141
|
+
toNum: ge,
|
|
142
|
+
toString: de,
|
|
143
|
+
unFormatRate: pe,
|
|
144
|
+
withInstall: Ne
|
|
145
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
146
|
+
export {
|
|
147
|
+
xe as a,
|
|
148
|
+
Oe as b,
|
|
149
|
+
$e as c,
|
|
150
|
+
g as d,
|
|
151
|
+
a as e,
|
|
152
|
+
m as f,
|
|
153
|
+
Se as g,
|
|
154
|
+
Pe as h,
|
|
155
|
+
be as r,
|
|
156
|
+
Le as u
|
|
157
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as h, ref as g, onMounted as w, createVNode as b } from "vue";
|
|
2
2
|
import { propTypes as m } from "../utils/vuePropTypes.js";
|
|
3
|
-
import { a as _ } from "../chunks/index-
|
|
3
|
+
import { a as _ } from "../chunks/index-aaoImdl9.js";
|
|
4
4
|
import { withInstall as A } from "../utils/withInstall.js";
|
|
5
5
|
import { isEdgeBrowser as C, isInMobileBrowser as p } from "../utils/is.js";
|
|
6
6
|
function d(r, o) {
|
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,9 @@ declare const JKVUEComps: {
|
|
|
74
74
|
power(base: utils.BigNumValType, exponent: utils.BigNumValType): number;
|
|
75
75
|
formatRate(val: utils.BigNumValType, unit?: string): string;
|
|
76
76
|
unFormatRate(val: utils.BigNumValType): number;
|
|
77
|
+
DOWN: 1;
|
|
78
|
+
UP: 0;
|
|
79
|
+
BigNumber: typeof import("bignumber.js").BigNumber;
|
|
77
80
|
propTypes: typeof import("./utils/vuePropTypes").default;
|
|
78
81
|
timeZoneOptions: utils.TimeZoneItem[];
|
|
79
82
|
withInstall<T_7>(component: T_7, alias?: string | undefined): T_7 & import("vue").Plugin;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c as e } from "./chunks/index-BP9Q78TM.js";
|
|
2
|
-
import { u as s } from "./chunks/index-
|
|
3
|
-
import { d as
|
|
2
|
+
import { u as s } from "./chunks/index-aaoImdl9.js";
|
|
3
|
+
import { d as m, h as l, e as n, f as u, g as p, b as g, a as f, c as h, r as N } from "./chunks/index-aaoImdl9.js";
|
|
4
4
|
import { GoogleAuth as c, toGoogleAuth as T } from "./components/GoogleAuth.js";
|
|
5
5
|
import { TelegramAuth as E, getTelegramAuthUrlParams as U, toTelegramAuth as b } from "./components/TelegramAuth.js";
|
|
6
|
-
import { is as
|
|
7
|
-
import {
|
|
8
|
-
import { propTypes as
|
|
9
|
-
import { timeZoneOptions as
|
|
10
|
-
import { withInstall as
|
|
6
|
+
import { is as A, isArray as B, isBoolean as D, isClient as I, isDate as O, isDef as S, isEdgeBrowser as w, isElement as L, isEmail as v, isEmpty as y, isFunction as F, isHtmlStr as G, isInMobileBrowser as R, isIp as W, isMap as q, isNull as C, isNullAndUnDef as M, isNullOrUnDef as V, isNumber as H, isObject as Z, isPromise as j, isPromiseLink as k, isRegExp as z, isServer as J, isString as K, isUnDef as Q, isUrl as X, isValidPhoneNumber as Y, isWindow as _, isZhLang as $ } from "./utils/is.js";
|
|
7
|
+
import { BigNumber as se, DOWN as ie, UP as re, add as te, divide as oe, formatRate as ae, helper as me, isBigNum as le, isBool as ne, isEqualTo as ue, isGreaterThan as pe, isGreaterThanOrEqualTo as ge, isInt as fe, isLessThan as he, isLessThanOrEqualTo as Ne, isNanValue as de, isNum as ce, multiply as Te, power as xe, subtract as Ee, toBigNum as Ue, toDecimalPlaces as be, toInt as Pe, toLocaleString as Ae, toNum as Be, toString as De, unFormatRate as Ie } from "./utils/math.js";
|
|
8
|
+
import { propTypes as Se } from "./utils/vuePropTypes.js";
|
|
9
|
+
import { timeZoneOptions as Le } from "./utils/timeZone.js";
|
|
10
|
+
import { withInstall as ye } from "./utils/withInstall.js";
|
|
11
11
|
const t = {
|
|
12
12
|
...e,
|
|
13
13
|
...s,
|
|
@@ -15,49 +15,52 @@ const t = {
|
|
|
15
15
|
Comps: e
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
+
se as BigNumber,
|
|
19
|
+
ie as DOWN,
|
|
18
20
|
c as GoogleAuth,
|
|
19
21
|
E as TelegramAuth,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
re as UP,
|
|
23
|
+
te as add,
|
|
24
|
+
m as deepMerge,
|
|
22
25
|
t as default,
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
l as desensitization,
|
|
27
|
+
oe as divide,
|
|
25
28
|
n as evalPro,
|
|
26
29
|
u as filterInputNum,
|
|
27
|
-
|
|
30
|
+
ae as formatRate,
|
|
28
31
|
p as generateFilterInputNumFn,
|
|
29
32
|
g as getRouterParams,
|
|
30
33
|
U as getTelegramAuthUrlParams,
|
|
31
34
|
f as getWebsiteUrl,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
me as helper,
|
|
36
|
+
A as is,
|
|
37
|
+
B as isArray,
|
|
38
|
+
le as isBigNum,
|
|
39
|
+
ne as isBool,
|
|
40
|
+
D as isBoolean,
|
|
41
|
+
I as isClient,
|
|
42
|
+
O as isDate,
|
|
43
|
+
S as isDef,
|
|
44
|
+
w as isEdgeBrowser,
|
|
45
|
+
L as isElement,
|
|
43
46
|
v as isEmail,
|
|
44
47
|
y as isEmpty,
|
|
45
|
-
|
|
48
|
+
ue as isEqualTo,
|
|
46
49
|
F as isFunction,
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
pe as isGreaterThan,
|
|
51
|
+
ge as isGreaterThanOrEqualTo,
|
|
49
52
|
G as isHtmlStr,
|
|
50
53
|
R as isInMobileBrowser,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
fe as isInt,
|
|
55
|
+
W as isIp,
|
|
56
|
+
he as isLessThan,
|
|
57
|
+
Ne as isLessThanOrEqualTo,
|
|
58
|
+
q as isMap,
|
|
59
|
+
de as isNanValue,
|
|
60
|
+
C as isNull,
|
|
61
|
+
M as isNullAndUnDef,
|
|
62
|
+
V as isNullOrUnDef,
|
|
63
|
+
ce as isNum,
|
|
61
64
|
H as isNumber,
|
|
62
65
|
Z as isObject,
|
|
63
66
|
j as isPromise,
|
|
@@ -70,21 +73,21 @@ export {
|
|
|
70
73
|
Y as isValidPhoneNumber,
|
|
71
74
|
_ as isWindow,
|
|
72
75
|
$ as isZhLang,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
Te as multiply,
|
|
77
|
+
xe as power,
|
|
78
|
+
Se as propTypes,
|
|
76
79
|
h as removeWhitespace,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
N as renderHtmlStr,
|
|
81
|
+
Ee as subtract,
|
|
82
|
+
Le as timeZoneOptions,
|
|
83
|
+
Ue as toBigNum,
|
|
84
|
+
be as toDecimalPlaces,
|
|
82
85
|
T as toGoogleAuth,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
Pe as toInt,
|
|
87
|
+
Ae as toLocaleString,
|
|
88
|
+
Be as toNum,
|
|
89
|
+
De as toString,
|
|
87
90
|
b as toTelegramAuth,
|
|
88
91
|
Ie as unFormatRate,
|
|
89
|
-
|
|
92
|
+
ye as withInstall
|
|
90
93
|
};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,75 +1,78 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import { is as r, isArray as t, isBoolean as o, isClient as a, isDate as n, isDef as l, isEdgeBrowser as m, isElement as
|
|
3
|
-
import {
|
|
4
|
-
import { propTypes as
|
|
5
|
-
import { timeZoneOptions as
|
|
6
|
-
import { withInstall as
|
|
7
|
-
import { d as
|
|
2
|
+
import { is as r, isArray as t, isBoolean as o, isClient as a, isDate as n, isDef as l, isEdgeBrowser as m, isElement as u, isEmail as p, isEmpty as g, isFunction as N, isHtmlStr as f, isInMobileBrowser as d, isIp as h, isMap as b, isNull as c, isNullAndUnDef as E, isNullOrUnDef as T, isNumber as x, isObject as B, isPromise as D, isPromiseLink as I, isRegExp as P, isServer as O, isString as S, isUnDef as U, isUrl as w, isValidPhoneNumber as L, isWindow as v, isZhLang as y } from "./is.js";
|
|
3
|
+
import { BigNumber as R, DOWN as W, UP as q, add as M, divide as A, formatRate as G, helper as H, isBigNum as V, isBool as Z, isEqualTo as j, isGreaterThan as k, isGreaterThanOrEqualTo as z, isInt as C, isLessThan as J, isLessThanOrEqualTo as K, isNanValue as Q, isNum as X, multiply as Y, power as _, subtract as $, toBigNum as ee, toDecimalPlaces as ie, toInt as se, toLocaleString as re, toNum as te, toString as oe, unFormatRate as ae } from "./math.js";
|
|
4
|
+
import { propTypes as le } from "./vuePropTypes.js";
|
|
5
|
+
import { timeZoneOptions as ue } from "./timeZone.js";
|
|
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 Te, c as xe, r as Be } from "../chunks/index-aaoImdl9.js";
|
|
8
8
|
export {
|
|
9
|
-
R as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
de as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
R as BigNumber,
|
|
10
|
+
W as DOWN,
|
|
11
|
+
q as UP,
|
|
12
|
+
M as add,
|
|
13
|
+
fe as deepMerge,
|
|
14
|
+
de as desensitization,
|
|
15
|
+
A as divide,
|
|
16
|
+
he as evalPro,
|
|
17
|
+
be as filterInputNum,
|
|
18
|
+
G as formatRate,
|
|
19
|
+
ce as generateFilterInputNumFn,
|
|
20
|
+
Ee as getRouterParams,
|
|
21
|
+
Te as getWebsiteUrl,
|
|
22
|
+
H as helper,
|
|
20
23
|
r as is,
|
|
21
24
|
t as isArray,
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
V as isBigNum,
|
|
26
|
+
Z as isBool,
|
|
24
27
|
o as isBoolean,
|
|
25
28
|
a as isClient,
|
|
26
29
|
n as isDate,
|
|
27
30
|
l as isDef,
|
|
28
31
|
m as isEdgeBrowser,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
u as isElement,
|
|
33
|
+
p as isEmail,
|
|
34
|
+
g as isEmpty,
|
|
35
|
+
j as isEqualTo,
|
|
36
|
+
N as isFunction,
|
|
37
|
+
k as isGreaterThan,
|
|
38
|
+
z as isGreaterThanOrEqualTo,
|
|
39
|
+
f as isHtmlStr,
|
|
40
|
+
d as isInMobileBrowser,
|
|
41
|
+
C as isInt,
|
|
39
42
|
h as isIp,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
J as isLessThan,
|
|
44
|
+
K as isLessThanOrEqualTo,
|
|
45
|
+
b as isMap,
|
|
46
|
+
Q as isNanValue,
|
|
47
|
+
c as isNull,
|
|
48
|
+
E as isNullAndUnDef,
|
|
49
|
+
T as isNullOrUnDef,
|
|
50
|
+
X as isNum,
|
|
48
51
|
x as isNumber,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
B as isObject,
|
|
53
|
+
D as isPromise,
|
|
54
|
+
I as isPromiseLink,
|
|
52
55
|
P as isRegExp,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
O as isServer,
|
|
57
|
+
S as isString,
|
|
58
|
+
U as isUnDef,
|
|
59
|
+
w as isUrl,
|
|
60
|
+
L as isValidPhoneNumber,
|
|
58
61
|
v as isWindow,
|
|
59
62
|
y as isZhLang,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
Y as multiply,
|
|
64
|
+
_ as power,
|
|
65
|
+
le as propTypes,
|
|
66
|
+
xe as removeWhitespace,
|
|
67
|
+
Be as renderHtmlStr,
|
|
68
|
+
$ as subtract,
|
|
69
|
+
ue as timeZoneOptions,
|
|
70
|
+
ee as toBigNum,
|
|
71
|
+
ie as toDecimalPlaces,
|
|
72
|
+
se as toInt,
|
|
73
|
+
re as toLocaleString,
|
|
74
|
+
te as toNum,
|
|
75
|
+
oe as toString,
|
|
76
|
+
ae as unFormatRate,
|
|
77
|
+
ge as withInstall
|
|
75
78
|
};
|
package/dist/utils/math.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import BJS from 'bignumber.js';
|
|
|
2
2
|
export type BigNumVal = Parameters<typeof BJS>[0];
|
|
3
3
|
export type BigNumValType = BigNumVal | undefined | null | boolean;
|
|
4
4
|
export type BigNumObj = BJS;
|
|
5
|
+
export declare const DOWN: 1;
|
|
6
|
+
export declare const UP: 0;
|
|
7
|
+
export declare const BigNumber: typeof BJS;
|
|
5
8
|
export declare function helper(val: BigNumValType): BigNumObj;
|
|
6
9
|
/** 是否为boolean值 */
|
|
7
10
|
export declare function isBool(val: any): val is boolean;
|
package/dist/utils/math.js
CHANGED
|
@@ -259,7 +259,7 @@ function Ee(a) {
|
|
|
259
259
|
;
|
|
260
260
|
}
|
|
261
261
|
return function(s, t, u, c, i) {
|
|
262
|
-
var f, l, o, h, N, m, T, D, L, A, _, v, te, ae, he,
|
|
262
|
+
var f, l, o, h, N, m, T, D, L, A, _, v, te, ae, he, W, ie, F = s.s == t.s ? 1 : -1, U = s.c, I = t.c;
|
|
263
263
|
if (!U || !U[0] || !I || !I[0])
|
|
264
264
|
return new g(
|
|
265
265
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
@@ -273,19 +273,19 @@ function Ee(a) {
|
|
|
273
273
|
if (I[o] > (U[o] || 0) && l--, F < 0)
|
|
274
274
|
L.push(1), h = !0;
|
|
275
275
|
else {
|
|
276
|
-
for (ae = U.length,
|
|
276
|
+
for (ae = U.length, W = I.length, o = 0, F += 2, N = $(i / (I[0] + 1)), N > 1 && (I = e(I, N, i), U = e(U, N, i), W = I.length, ae = U.length), te = W, A = U.slice(0, W), _ = A.length; _ < W; A[_++] = 0)
|
|
277
277
|
;
|
|
278
278
|
ie = I.slice(), ie = [0].concat(ie), he = I[0], I[1] >= i / 2 && he++;
|
|
279
279
|
do {
|
|
280
|
-
if (N = 0, f = r(I, A,
|
|
281
|
-
if (v = A[0],
|
|
280
|
+
if (N = 0, f = r(I, A, W, _), f < 0) {
|
|
281
|
+
if (v = A[0], W != _ && (v = v * i + (A[1] || 0)), N = $(v / he), N > 1)
|
|
282
282
|
for (N >= i && (N = i - 1), m = e(I, N, i), T = m.length, _ = A.length; r(m, A, T, _) == 1; )
|
|
283
|
-
N--, n(m,
|
|
283
|
+
N--, n(m, W < T ? ie : I, T, i), T = m.length, f = 1;
|
|
284
284
|
else
|
|
285
285
|
N == 0 && (f = N = 1), m = I.slice(), T = m.length;
|
|
286
286
|
if (T < _ && (m = [0].concat(m)), n(A, m, _, i), _ = A.length, f == -1)
|
|
287
|
-
for (; r(I, A,
|
|
288
|
-
N++, n(A,
|
|
287
|
+
for (; r(I, A, W, _) < 1; )
|
|
288
|
+
N++, n(A, W < _ ? ie : I, _, i), _ = A.length;
|
|
289
289
|
} else
|
|
290
290
|
f === 0 && (N++, A = [0]);
|
|
291
291
|
L[o++] = N, A[0] ? A[_++] = U[te] || 0 : (A = [U[te]], _ = 1);
|
|
@@ -694,125 +694,128 @@ function Z(a, p, d) {
|
|
|
694
694
|
p < O && (a = a.slice(0, p) + "." + a.slice(p));
|
|
695
695
|
return a;
|
|
696
696
|
}
|
|
697
|
-
var
|
|
697
|
+
var X = Ee();
|
|
698
|
+
const Oe = X.ROUND_DOWN, de = X.ROUND_UP, De = X;
|
|
698
699
|
function x(a) {
|
|
699
700
|
if (xe(a))
|
|
700
|
-
return
|
|
701
|
+
return X(~~a);
|
|
701
702
|
if (!a)
|
|
702
|
-
return
|
|
703
|
+
return X(0);
|
|
703
704
|
if (Se(a))
|
|
704
|
-
return a.isNaN() ?
|
|
705
|
-
const p =
|
|
706
|
-
return p.isNaN() ?
|
|
705
|
+
return a.isNaN() ? X(0) : a;
|
|
706
|
+
const p = X(a);
|
|
707
|
+
return p.isNaN() ? X(0) : p;
|
|
707
708
|
}
|
|
708
709
|
function xe(a) {
|
|
709
710
|
return typeof a == "boolean";
|
|
710
711
|
}
|
|
711
712
|
function Se(a) {
|
|
712
|
-
return
|
|
713
|
+
return X.isBigNumber(a);
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function Ie(a) {
|
|
715
716
|
return typeof a == "number" && !Be(a);
|
|
716
717
|
}
|
|
717
718
|
function Be(a) {
|
|
718
|
-
return a == null || a == null ? !1 :
|
|
719
|
+
return a == null || a == null ? !1 : X(a).isNaN();
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
-
return a == null || a == null ? !1 :
|
|
721
|
+
function Pe(a) {
|
|
722
|
+
return a == null || a == null ? !1 : X(a).isInteger();
|
|
722
723
|
}
|
|
723
|
-
function
|
|
724
|
+
function Ae(a, p) {
|
|
724
725
|
return x(a).isGreaterThan(x(p));
|
|
725
726
|
}
|
|
726
|
-
function
|
|
727
|
+
function Le(a, p) {
|
|
727
728
|
return x(a).isLessThan(x(p));
|
|
728
729
|
}
|
|
729
|
-
function
|
|
730
|
+
function Me(a, p) {
|
|
730
731
|
return x(a).isEqualTo(x(p));
|
|
731
732
|
}
|
|
732
|
-
function
|
|
733
|
+
function ve(a, p) {
|
|
733
734
|
return x(a).isGreaterThanOrEqualTo(x(p));
|
|
734
735
|
}
|
|
735
|
-
function
|
|
736
|
+
function Ue(a, p) {
|
|
736
737
|
return x(a).isLessThanOrEqualTo(x(p));
|
|
737
738
|
}
|
|
738
|
-
const de = W.ROUND_DOWN, Ae = W.ROUND_UP;
|
|
739
739
|
function Re(a) {
|
|
740
740
|
return x(a);
|
|
741
741
|
}
|
|
742
742
|
function re(a) {
|
|
743
743
|
return x(a).toNumber();
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
return re(x(a).integerValue(p ?
|
|
745
|
+
function Ce(a, p = !1) {
|
|
746
|
+
return re(x(a).integerValue(p ? de : Oe));
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function Ge(a) {
|
|
749
749
|
return x(a).toString();
|
|
750
750
|
}
|
|
751
751
|
function Te(a, p, d = !1) {
|
|
752
752
|
const O = x(a);
|
|
753
|
-
return re(p !== void 0 ? O.decimalPlaces(p, d ?
|
|
753
|
+
return re(p !== void 0 ? O.decimalPlaces(p, d ? de : Oe) : O);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function ke(a) {
|
|
756
756
|
return x(a).toFormat();
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function qe(...a) {
|
|
759
759
|
if (a.length === 0)
|
|
760
760
|
return 0;
|
|
761
761
|
const p = a.reduce((d, O) => x(d).plus(x(O)), 0);
|
|
762
762
|
return re(p);
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Fe(...a) {
|
|
765
765
|
if (a.length === 0)
|
|
766
766
|
return 0;
|
|
767
767
|
const p = a.reduce((d, O) => x(d).minus(x(O)));
|
|
768
768
|
return re(p);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ye(...a) {
|
|
771
771
|
if (a.length === 0)
|
|
772
772
|
return 0;
|
|
773
773
|
const p = a.reduce((d, O) => x(d).times(x(O)), 1);
|
|
774
774
|
return re(p);
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function $e(...a) {
|
|
777
777
|
if (a.length === 0)
|
|
778
778
|
return 0;
|
|
779
779
|
const p = a.map((O) => Re(O));
|
|
780
780
|
return p.some((O) => O.isZero()) ? 0 : p.reduce((O, w) => O.dividedBy(w)).toNumber();
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function ze(a, p) {
|
|
783
783
|
return re(x(a).pow(x(p)));
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function He(a, p = "%") {
|
|
786
786
|
const d = x(a).times(100);
|
|
787
|
-
return `${
|
|
787
|
+
return `${Ae(d, 0) ? Te(d, 2) : 0}${p}`;
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function Ve(a) {
|
|
790
790
|
const p = x(a).div(100);
|
|
791
|
-
return
|
|
791
|
+
return Ae(p, 0) ? Te(p, 4) : 0;
|
|
792
792
|
}
|
|
793
793
|
export {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
794
|
+
De as BigNumber,
|
|
795
|
+
Oe as DOWN,
|
|
796
|
+
de as UP,
|
|
797
|
+
qe as add,
|
|
798
|
+
$e as divide,
|
|
799
|
+
He as formatRate,
|
|
797
800
|
x as helper,
|
|
798
801
|
Se as isBigNum,
|
|
799
802
|
xe as isBool,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
803
|
+
Me as isEqualTo,
|
|
804
|
+
Ae as isGreaterThan,
|
|
805
|
+
ve as isGreaterThanOrEqualTo,
|
|
806
|
+
Pe as isInt,
|
|
807
|
+
Le as isLessThan,
|
|
808
|
+
Ue as isLessThanOrEqualTo,
|
|
806
809
|
Be as isNanValue,
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
810
|
+
Ie as isNum,
|
|
811
|
+
ye as multiply,
|
|
812
|
+
ze as power,
|
|
813
|
+
Fe as subtract,
|
|
811
814
|
Re as toBigNum,
|
|
812
815
|
Te as toDecimalPlaces,
|
|
813
|
-
|
|
814
|
-
|
|
816
|
+
Ce as toInt,
|
|
817
|
+
ke as toLocaleString,
|
|
815
818
|
re as toNum,
|
|
816
|
-
|
|
817
|
-
|
|
819
|
+
Ge as toString,
|
|
820
|
+
Ve as unFormatRate
|
|
818
821
|
};
|
package/package.json
CHANGED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { nextTick as p, createVNode as h } from "vue";
|
|
2
|
-
import { isString as u, isHtmlStr as l, isObject as f, isNumber as c, is as w, isArray as S, isBoolean as N, isClient as b, isDate as x, isDef as $, isEdgeBrowser as O, isElement as T, isEmail as P, isEmpty as v, isFunction as y, isInMobileBrowser as E, isIp as I, isMap as L, isNull as B, isNullAndUnDef as U, isNullOrUnDef as q, isPromise as D, isPromiseLink as F, isRegExp as M, isServer as R, isUnDef as k, isUrl as _, isValidPhoneNumber as j, isWindow as z, isZhLang as H } from "../utils/is.js";
|
|
3
|
-
import { add as V, divide as W, formatRate as A, helper as G, isBigNum as Z, isBool as C, isEqualTo as J, isGreaterThan as K, isGreaterThanOrEqualTo as Q, isInt as X, isLessThan as Y, isLessThanOrEqualTo as ee, isNanValue as ie, isNum as te, multiply as re, power as ne, subtract as se, toBigNum as oe, toDecimalPlaces as ue, toInt as ae, toLocaleString as le, toNum as fe, toString as ce, unFormatRate as me } from "../utils/math.js";
|
|
4
|
-
import { propTypes as de } from "../utils/vuePropTypes.js";
|
|
5
|
-
import { timeZoneOptions as ge } from "../utils/timeZone.js";
|
|
6
|
-
import { withInstall as pe } from "../utils/withInstall.js";
|
|
7
|
-
function a(i) {
|
|
8
|
-
try {
|
|
9
|
-
return new Function(`'use strict'; return (${i});`)();
|
|
10
|
-
} catch {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function m(i, r = "float", t = 6) {
|
|
15
|
-
let e = String(i);
|
|
16
|
-
if (e = e.replace(/(^\s*)|(\s*$)/g, ""), e !== "") {
|
|
17
|
-
const s = e.indexOf("0") === 0 && e.length > 1 && e.indexOf(".") !== 1, n = r === "int" ? /[^\d]/g : /[^\d.]/g;
|
|
18
|
-
if (e = e.replace(n, ""), s)
|
|
19
|
-
return "0";
|
|
20
|
-
if (r === "int")
|
|
21
|
-
e = e.indexOf("0") === 0 && e.length > 1 ? e.substring(0, e.length - 1) : e;
|
|
22
|
-
else {
|
|
23
|
-
const o = a(`/\\.{${t},}/g`), g = a(`/^(\\d?)+(\\.\\d{0,${t}})?$/`);
|
|
24
|
-
e.indexOf(".") === 0 ? (e = "", e = e.replace(/[^$#$]/g, "0."), e = e.replace(o, ".")) : g.test(e) || (e = e.substring(0, e.length - 1));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return e;
|
|
28
|
-
}
|
|
29
|
-
function he(i, r, t, e = "int", s = 6) {
|
|
30
|
-
return (n) => {
|
|
31
|
-
p().then(() => {
|
|
32
|
-
var o;
|
|
33
|
-
i[r] = m((o = n == null ? void 0 : n.target) == null ? void 0 : o.value, e, s), t == null || t();
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function we(i) {
|
|
38
|
-
return !u(i) || !l(i) ? i : h("div", { innerHTML: i });
|
|
39
|
-
}
|
|
40
|
-
function Se() {
|
|
41
|
-
return window ? `${window.location.protocol}//${window.location.hostname}` : "";
|
|
42
|
-
}
|
|
43
|
-
function Ne() {
|
|
44
|
-
const i = new URLSearchParams(window.location.search);
|
|
45
|
-
if (!i.size)
|
|
46
|
-
return;
|
|
47
|
-
const r = {};
|
|
48
|
-
for (const [t, e] of i.entries())
|
|
49
|
-
r[t] = e;
|
|
50
|
-
return r;
|
|
51
|
-
}
|
|
52
|
-
function be(i) {
|
|
53
|
-
return u(i) ? i.replace(/\s+/g, "") : "";
|
|
54
|
-
}
|
|
55
|
-
function d(i = {}, r = {}) {
|
|
56
|
-
let t;
|
|
57
|
-
for (t in r)
|
|
58
|
-
i[t] = f(i[t]) ? d(i[t], r[t]) : i[t] = r[t];
|
|
59
|
-
return i;
|
|
60
|
-
}
|
|
61
|
-
function xe(i, r = 6, t = {
|
|
62
|
-
showPrefix: !0,
|
|
63
|
-
showSuffix: !0,
|
|
64
|
-
middleStr: "****"
|
|
65
|
-
}) {
|
|
66
|
-
if (!u(i) && !c(i))
|
|
67
|
-
return i;
|
|
68
|
-
const e = String(i), s = (e == null ? void 0 : e.length) ?? 0;
|
|
69
|
-
if (!e || !s || r <= 0)
|
|
70
|
-
return e;
|
|
71
|
-
const n = t.showPrefix ? e.substring(0, r) : "", o = t.showSuffix ? e.substring(s - r) : "";
|
|
72
|
-
return `${n}${t.middleStr}${o}`;
|
|
73
|
-
}
|
|
74
|
-
const Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
|
-
__proto__: null,
|
|
76
|
-
add: V,
|
|
77
|
-
deepMerge: d,
|
|
78
|
-
desensitization: xe,
|
|
79
|
-
divide: W,
|
|
80
|
-
evalPro: a,
|
|
81
|
-
filterInputNum: m,
|
|
82
|
-
formatRate: A,
|
|
83
|
-
generateFilterInputNumFn: he,
|
|
84
|
-
getRouterParams: Ne,
|
|
85
|
-
getWebsiteUrl: Se,
|
|
86
|
-
helper: G,
|
|
87
|
-
is: w,
|
|
88
|
-
isArray: S,
|
|
89
|
-
isBigNum: Z,
|
|
90
|
-
isBool: C,
|
|
91
|
-
isBoolean: N,
|
|
92
|
-
isClient: b,
|
|
93
|
-
isDate: x,
|
|
94
|
-
isDef: $,
|
|
95
|
-
isEdgeBrowser: O,
|
|
96
|
-
isElement: T,
|
|
97
|
-
isEmail: P,
|
|
98
|
-
isEmpty: v,
|
|
99
|
-
isEqualTo: J,
|
|
100
|
-
isFunction: y,
|
|
101
|
-
isGreaterThan: K,
|
|
102
|
-
isGreaterThanOrEqualTo: Q,
|
|
103
|
-
isHtmlStr: l,
|
|
104
|
-
isInMobileBrowser: E,
|
|
105
|
-
isInt: X,
|
|
106
|
-
isIp: I,
|
|
107
|
-
isLessThan: Y,
|
|
108
|
-
isLessThanOrEqualTo: ee,
|
|
109
|
-
isMap: L,
|
|
110
|
-
isNanValue: ie,
|
|
111
|
-
isNull: B,
|
|
112
|
-
isNullAndUnDef: U,
|
|
113
|
-
isNullOrUnDef: q,
|
|
114
|
-
isNum: te,
|
|
115
|
-
isNumber: c,
|
|
116
|
-
isObject: f,
|
|
117
|
-
isPromise: D,
|
|
118
|
-
isPromiseLink: F,
|
|
119
|
-
isRegExp: M,
|
|
120
|
-
isServer: R,
|
|
121
|
-
isString: u,
|
|
122
|
-
isUnDef: k,
|
|
123
|
-
isUrl: _,
|
|
124
|
-
isValidPhoneNumber: j,
|
|
125
|
-
isWindow: z,
|
|
126
|
-
isZhLang: H,
|
|
127
|
-
multiply: re,
|
|
128
|
-
power: ne,
|
|
129
|
-
propTypes: de,
|
|
130
|
-
removeWhitespace: be,
|
|
131
|
-
renderHtmlStr: we,
|
|
132
|
-
subtract: se,
|
|
133
|
-
timeZoneOptions: ge,
|
|
134
|
-
toBigNum: oe,
|
|
135
|
-
toDecimalPlaces: ue,
|
|
136
|
-
toInt: ae,
|
|
137
|
-
toLocaleString: le,
|
|
138
|
-
toNum: fe,
|
|
139
|
-
toString: ce,
|
|
140
|
-
unFormatRate: me,
|
|
141
|
-
withInstall: pe
|
|
142
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
143
|
-
export {
|
|
144
|
-
Se as a,
|
|
145
|
-
Ne as b,
|
|
146
|
-
be as c,
|
|
147
|
-
d,
|
|
148
|
-
a as e,
|
|
149
|
-
m as f,
|
|
150
|
-
he as g,
|
|
151
|
-
xe as h,
|
|
152
|
-
we as r,
|
|
153
|
-
Ee as u
|
|
154
|
-
};
|