jk-vue-comps 0.1.9 → 0.1.10
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-BE5vnR2C.js +175 -0
- package/dist/chunks/{index-BP9Q78TM.js → index-DyiqKziC.js} +1 -1
- package/dist/components/TelegramAuth.js +1 -1
- package/dist/index.d.ts +32 -30
- package/dist/index.js +77 -75
- package/dist/utils/index.d.ts +8 -1
- package/dist/utils/index.js +29 -27
- package/package.json +1 -1
- package/dist/chunks/index-aaoImdl9.js +0 -157
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { nextTick as S, createVNode as N } from "vue";
|
|
2
|
+
import { isString as u, isHtmlStr as m, isObject as l, isNumber as p, is as $, isArray as b, isBoolean as x, isClient as O, isDate as v, isDef as P, isEdgeBrowser as T, isElement as U, isEmail as y, isEmpty as E, isFunction as B, isInMobileBrowser as I, isIp as L, isMap as D, isNull as k, isNullAndUnDef as q, isNullOrUnDef as F, isPromise as M, isPromiseLink as R, isRegExp as _, isServer as W, isUnDef as j, isUrl as z, isValidPhoneNumber as H, isWindow as V, isZhLang as A } from "../utils/is.js";
|
|
3
|
+
import { isNanValue as d, toNum as g, BigNumber as C, DOWN as G, UP as Z, add as J, divide as K, formatRate as Q, helper as X, isBigNum as Y, isBool as ee, isEqualTo as ie, isGreaterThan as te, isGreaterThanOrEqualTo as ne, isInt as re, isLessThan as oe, isLessThanOrEqualTo as se, isNum as ue, multiply as ae, power as le, subtract as fe, toBigNum as ce, toDecimalPlaces as me, toInt as pe, toLocaleString as de, toString as ge, unFormatRate as he } from "../utils/math.js";
|
|
4
|
+
import { propTypes as we } from "../utils/vuePropTypes.js";
|
|
5
|
+
import { timeZoneOptions as Se } 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 h(i, n = "float", t = 6) {
|
|
15
|
+
let e = String(i);
|
|
16
|
+
if (e = e.replace(/(^\s*)|(\s*$)/g, ""), e !== "") {
|
|
17
|
+
const r = e.indexOf("0") === 0 && e.length > 1 && e.indexOf(".") !== 1, o = n === "int" ? /[^\d]/g : /[^\d.]/g;
|
|
18
|
+
if (e = e.replace(o, ""), r)
|
|
19
|
+
return "0";
|
|
20
|
+
if (n === "int")
|
|
21
|
+
e = e.indexOf("0") === 0 && e.length > 1 ? e.substring(0, e.length - 1) : e;
|
|
22
|
+
else {
|
|
23
|
+
const s = a(`/\\.{${t},}/g`), f = a(`/^(\\d?)+(\\.\\d{0,${t}})?$/`);
|
|
24
|
+
e.indexOf(".") === 0 ? (e = "", e = e.replace(/[^$#$]/g, "0."), e = e.replace(s, ".")) : f.test(e) || (e = e.substring(0, e.length - 1));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
function $e(i, n, t, e = "int", r = 6) {
|
|
30
|
+
return (o) => {
|
|
31
|
+
S().then(() => {
|
|
32
|
+
var s;
|
|
33
|
+
i[n] = h((s = o == null ? void 0 : o.target) == null ? void 0 : s.value, e, r), t == null || t();
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function be(i) {
|
|
38
|
+
return !u(i) || !m(i) ? i : N("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 n = {};
|
|
48
|
+
for (const [t, e] of i.entries())
|
|
49
|
+
n[t] = e;
|
|
50
|
+
return n;
|
|
51
|
+
}
|
|
52
|
+
function ve(i) {
|
|
53
|
+
return u(i) ? i.replace(/\s+/g, "") : "";
|
|
54
|
+
}
|
|
55
|
+
function w(i = {}, n = {}) {
|
|
56
|
+
let t;
|
|
57
|
+
for (t in n)
|
|
58
|
+
i[t] = l(i[t]) ? w(i[t], n[t]) : i[t] = n[t];
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
function Pe(i, n = 6, t = {
|
|
62
|
+
showPrefix: !0,
|
|
63
|
+
showSuffix: !0,
|
|
64
|
+
middleStr: "****"
|
|
65
|
+
}) {
|
|
66
|
+
if (!u(i) && !p(i))
|
|
67
|
+
return i;
|
|
68
|
+
const e = String(i), r = (e == null ? void 0 : e.length) ?? 0;
|
|
69
|
+
if (!e || !r || n <= 0)
|
|
70
|
+
return e;
|
|
71
|
+
const o = t.showPrefix ? e.substring(0, n) : "", s = t.showSuffix ? e.substring(r - n) : "";
|
|
72
|
+
return `${o}${t.middleStr}${s}`;
|
|
73
|
+
}
|
|
74
|
+
function Te(i, n = "px") {
|
|
75
|
+
if (!(i === null || i === "" || i === void 0))
|
|
76
|
+
return d(i) ? String(i) : `${g(i)}${n}`;
|
|
77
|
+
}
|
|
78
|
+
function Ue(i) {
|
|
79
|
+
return i ? l(i) ? i : i.split(";").reduce((n, t) => {
|
|
80
|
+
const [e, r] = t.trim().split(":");
|
|
81
|
+
if (e) {
|
|
82
|
+
const s = e.trim().replace(/-(\w)/g, (f, c) => c ? c.toUpperCase() : "");
|
|
83
|
+
n[s] = r.trim();
|
|
84
|
+
}
|
|
85
|
+
return n;
|
|
86
|
+
}, {}) : {};
|
|
87
|
+
}
|
|
88
|
+
const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
89
|
+
__proto__: null,
|
|
90
|
+
BigNumber: C,
|
|
91
|
+
DOWN: G,
|
|
92
|
+
UP: Z,
|
|
93
|
+
add: J,
|
|
94
|
+
deepMerge: w,
|
|
95
|
+
desensitization: Pe,
|
|
96
|
+
divide: K,
|
|
97
|
+
evalPro: a,
|
|
98
|
+
filterInputNum: h,
|
|
99
|
+
formatRate: Q,
|
|
100
|
+
generateFilterInputNumFn: $e,
|
|
101
|
+
getRouterParams: Oe,
|
|
102
|
+
getWebsiteUrl: xe,
|
|
103
|
+
helper: X,
|
|
104
|
+
is: $,
|
|
105
|
+
isArray: b,
|
|
106
|
+
isBigNum: Y,
|
|
107
|
+
isBool: ee,
|
|
108
|
+
isBoolean: x,
|
|
109
|
+
isClient: O,
|
|
110
|
+
isDate: v,
|
|
111
|
+
isDef: P,
|
|
112
|
+
isEdgeBrowser: T,
|
|
113
|
+
isElement: U,
|
|
114
|
+
isEmail: y,
|
|
115
|
+
isEmpty: E,
|
|
116
|
+
isEqualTo: ie,
|
|
117
|
+
isFunction: B,
|
|
118
|
+
isGreaterThan: te,
|
|
119
|
+
isGreaterThanOrEqualTo: ne,
|
|
120
|
+
isHtmlStr: m,
|
|
121
|
+
isInMobileBrowser: I,
|
|
122
|
+
isInt: re,
|
|
123
|
+
isIp: L,
|
|
124
|
+
isLessThan: oe,
|
|
125
|
+
isLessThanOrEqualTo: se,
|
|
126
|
+
isMap: D,
|
|
127
|
+
isNanValue: d,
|
|
128
|
+
isNull: k,
|
|
129
|
+
isNullAndUnDef: q,
|
|
130
|
+
isNullOrUnDef: F,
|
|
131
|
+
isNum: ue,
|
|
132
|
+
isNumber: p,
|
|
133
|
+
isObject: l,
|
|
134
|
+
isPromise: M,
|
|
135
|
+
isPromiseLink: R,
|
|
136
|
+
isRegExp: _,
|
|
137
|
+
isServer: W,
|
|
138
|
+
isString: u,
|
|
139
|
+
isUnDef: j,
|
|
140
|
+
isUrl: z,
|
|
141
|
+
isValidPhoneNumber: H,
|
|
142
|
+
isWindow: V,
|
|
143
|
+
isZhLang: A,
|
|
144
|
+
multiply: ae,
|
|
145
|
+
power: le,
|
|
146
|
+
propTypes: we,
|
|
147
|
+
removeWhitespace: ve,
|
|
148
|
+
renderHtmlStr: be,
|
|
149
|
+
subtract: fe,
|
|
150
|
+
timeZoneOptions: Se,
|
|
151
|
+
toBigNum: ce,
|
|
152
|
+
toDecimalPlaces: me,
|
|
153
|
+
toInt: pe,
|
|
154
|
+
toLocaleString: de,
|
|
155
|
+
toNum: g,
|
|
156
|
+
toString: ge,
|
|
157
|
+
toStyleObject: Ue,
|
|
158
|
+
toStyleUnit: Te,
|
|
159
|
+
unFormatRate: he,
|
|
160
|
+
withInstall: Ne
|
|
161
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
162
|
+
export {
|
|
163
|
+
ke as U,
|
|
164
|
+
xe as a,
|
|
165
|
+
Oe as b,
|
|
166
|
+
ve as c,
|
|
167
|
+
w as d,
|
|
168
|
+
a as e,
|
|
169
|
+
h as f,
|
|
170
|
+
$e as g,
|
|
171
|
+
Pe as h,
|
|
172
|
+
Ue as i,
|
|
173
|
+
be as r,
|
|
174
|
+
Te as t
|
|
175
|
+
};
|
|
@@ -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-BE5vnR2C.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
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as Comps from './components';
|
|
2
|
+
import * as Utils from './utils';
|
|
3
3
|
export * from './components';
|
|
4
4
|
export * from './utils';
|
|
5
5
|
declare const JKVUEComps: {
|
|
6
|
-
Utils: typeof
|
|
7
|
-
Comps: typeof
|
|
6
|
+
Utils: typeof Utils;
|
|
7
|
+
Comps: typeof Comps;
|
|
8
8
|
evalPro(str: string): any;
|
|
9
9
|
filterInputNum(eventVal: string | number, type?: "int" | "float", maxDecimal?: number): string;
|
|
10
|
-
generateFilterInputNumFn<T extends
|
|
10
|
+
generateFilterInputNumFn<T extends Recordable<any>, K extends keyof T>(obj: T, key: K, fn?: (() => void) | undefined, type?: "int" | "float", maxDecimal?: number): (e: ChangeEvent) => void;
|
|
11
11
|
renderHtmlStr(html: string): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}>;
|
|
@@ -20,6 +20,8 @@ declare const JKVUEComps: {
|
|
|
20
20
|
showSuffix?: boolean | undefined;
|
|
21
21
|
middleStr?: string | undefined;
|
|
22
22
|
}): string | undefined;
|
|
23
|
+
toStyleUnit(str?: string | number | null | undefined, unit?: string): string | undefined;
|
|
24
|
+
toStyleObject(style?: string | Recordable<any> | null | undefined): Recordable<any>;
|
|
23
25
|
is(val: unknown, type: string): boolean;
|
|
24
26
|
isDef<T_2 = unknown>(val?: T_2 | undefined): val is T_2;
|
|
25
27
|
isUnDef<T_3 = unknown>(val?: T_3 | undefined): val is T_3;
|
|
@@ -50,7 +52,7 @@ declare const JKVUEComps: {
|
|
|
50
52
|
isIp: (ip: string) => boolean;
|
|
51
53
|
isEmail: (email: string) => boolean;
|
|
52
54
|
isHtmlStr: (str: string) => boolean;
|
|
53
|
-
helper(val:
|
|
55
|
+
helper(val: Utils.BigNumValType): import("bignumber.js").BigNumber;
|
|
54
56
|
isBool(val: any): val is boolean;
|
|
55
57
|
isBigNum(val: any): val is import("bignumber.js").BigNumber;
|
|
56
58
|
isNum(val: any): val is number;
|
|
@@ -61,24 +63,24 @@ declare const JKVUEComps: {
|
|
|
61
63
|
isEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
|
|
62
64
|
isGreaterThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
|
|
63
65
|
isLessThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
|
|
64
|
-
toBigNum(val:
|
|
65
|
-
toNum(val:
|
|
66
|
-
toInt(val:
|
|
67
|
-
toString(val:
|
|
68
|
-
toDecimalPlaces(val:
|
|
69
|
-
toLocaleString(val:
|
|
70
|
-
add(...vals:
|
|
71
|
-
subtract(...vals:
|
|
72
|
-
multiply(...vals:
|
|
73
|
-
divide(...vals:
|
|
74
|
-
power(base:
|
|
75
|
-
formatRate(val:
|
|
76
|
-
unFormatRate(val:
|
|
66
|
+
toBigNum(val: Utils.BigNumValType): import("bignumber.js").BigNumber;
|
|
67
|
+
toNum(val: Utils.BigNumValType): number;
|
|
68
|
+
toInt(val: Utils.BigNumValType, isUp?: boolean): number;
|
|
69
|
+
toString(val: Utils.BigNumValType): string;
|
|
70
|
+
toDecimalPlaces(val: Utils.BigNumValType, decimal?: number | undefined, isUp?: boolean): number;
|
|
71
|
+
toLocaleString(val: Utils.BigNumValType): string;
|
|
72
|
+
add(...vals: Utils.BigNumValType[]): number;
|
|
73
|
+
subtract(...vals: Utils.BigNumValType[]): number;
|
|
74
|
+
multiply(...vals: Utils.BigNumValType[]): number;
|
|
75
|
+
divide(...vals: Utils.BigNumValType[]): number;
|
|
76
|
+
power(base: Utils.BigNumValType, exponent: Utils.BigNumValType): number;
|
|
77
|
+
formatRate(val: Utils.BigNumValType, unit?: string): string;
|
|
78
|
+
unFormatRate(val: Utils.BigNumValType): number;
|
|
77
79
|
DOWN: 1;
|
|
78
80
|
UP: 0;
|
|
79
81
|
BigNumber: typeof import("bignumber.js").BigNumber;
|
|
80
82
|
propTypes: typeof import("./utils/vuePropTypes").default;
|
|
81
|
-
timeZoneOptions:
|
|
83
|
+
timeZoneOptions: Utils.TimeZoneItem[];
|
|
82
84
|
withInstall<T_7>(component: T_7, alias?: string | undefined): T_7 & import("vue").Plugin;
|
|
83
85
|
toGoogleAuth(clientId: string, redirectUri: string): void;
|
|
84
86
|
GoogleAuth: {
|
|
@@ -169,10 +171,10 @@ declare const JKVUEComps: {
|
|
|
169
171
|
startCheck: () => void;
|
|
170
172
|
};
|
|
171
173
|
}>> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & ({
|
|
172
|
-
readonly toGoogleAuth: typeof
|
|
174
|
+
readonly toGoogleAuth: typeof Comps.toGoogleAuth;
|
|
173
175
|
} & import("vue").Plugin)));
|
|
174
176
|
toTelegramAuth(botId: number, toPath: string): void;
|
|
175
|
-
getTelegramAuthUrlParams():
|
|
177
|
+
getTelegramAuthUrlParams(): Comps.TgUserData | null;
|
|
176
178
|
TelegramAuth: {
|
|
177
179
|
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
178
180
|
botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
|
|
@@ -182,10 +184,10 @@ declare const JKVUEComps: {
|
|
|
182
184
|
default: string;
|
|
183
185
|
};
|
|
184
186
|
}>> & {
|
|
185
|
-
onCallback?: ((_user:
|
|
187
|
+
onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
|
|
186
188
|
onRejectCallback?: (() => any) | undefined;
|
|
187
189
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
188
|
-
callback: (_user:
|
|
190
|
+
callback: (_user: Comps.TgUserData) => true;
|
|
189
191
|
rejectCallback: () => true;
|
|
190
192
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
191
193
|
botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
|
|
@@ -195,7 +197,7 @@ declare const JKVUEComps: {
|
|
|
195
197
|
default: string;
|
|
196
198
|
};
|
|
197
199
|
}>> & {
|
|
198
|
-
onCallback?: ((_user:
|
|
200
|
+
onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
|
|
199
201
|
onRejectCallback?: (() => any) | undefined;
|
|
200
202
|
}, {
|
|
201
203
|
botId: number;
|
|
@@ -219,7 +221,7 @@ declare const JKVUEComps: {
|
|
|
219
221
|
default: string;
|
|
220
222
|
};
|
|
221
223
|
}>> & {
|
|
222
|
-
onCallback?: ((_user:
|
|
224
|
+
onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
|
|
223
225
|
onRejectCallback?: (() => any) | undefined;
|
|
224
226
|
}, () => JSX.Element, {}, {}, {}, {
|
|
225
227
|
botId: number;
|
|
@@ -236,10 +238,10 @@ declare const JKVUEComps: {
|
|
|
236
238
|
default: string;
|
|
237
239
|
};
|
|
238
240
|
}>> & {
|
|
239
|
-
onCallback?: ((_user:
|
|
241
|
+
onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
|
|
240
242
|
onRejectCallback?: (() => any) | undefined;
|
|
241
243
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
242
|
-
callback: (_user:
|
|
244
|
+
callback: (_user: Comps.TgUserData) => true;
|
|
243
245
|
rejectCallback: () => true;
|
|
244
246
|
}, string, {
|
|
245
247
|
botId: number;
|
|
@@ -249,8 +251,8 @@ declare const JKVUEComps: {
|
|
|
249
251
|
startCheck: () => void;
|
|
250
252
|
};
|
|
251
253
|
}>> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & ({
|
|
252
|
-
readonly toTelegramAuth: typeof
|
|
253
|
-
readonly getTelegramAuthUrlParams: typeof
|
|
254
|
+
readonly toTelegramAuth: typeof Comps.toTelegramAuth;
|
|
255
|
+
readonly getTelegramAuthUrlParams: typeof Comps.getTelegramAuthUrlParams;
|
|
254
256
|
} & import("vue").Plugin)));
|
|
255
257
|
};
|
|
256
258
|
export default JKVUEComps;
|
package/dist/index.js
CHANGED
|
@@ -1,93 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { d as
|
|
4
|
-
import { GoogleAuth as c, toGoogleAuth as
|
|
5
|
-
import { TelegramAuth as E, getTelegramAuthUrlParams as
|
|
6
|
-
import { is as
|
|
7
|
-
import { BigNumber as
|
|
8
|
-
import { propTypes as
|
|
9
|
-
import { timeZoneOptions as
|
|
10
|
-
import { withInstall as
|
|
11
|
-
const
|
|
1
|
+
import { C as e } from "./chunks/index-DyiqKziC.js";
|
|
2
|
+
import { U as s } from "./chunks/index-BE5vnR2C.js";
|
|
3
|
+
import { d as l, h as m, e as n, f as u, g as p, b as g, a as f, c as h, r as N, i as d, t as T } from "./chunks/index-BE5vnR2C.js";
|
|
4
|
+
import { GoogleAuth as c, toGoogleAuth as x } from "./components/GoogleAuth.js";
|
|
5
|
+
import { TelegramAuth as E, getTelegramAuthUrlParams as P, toTelegramAuth as S } from "./components/TelegramAuth.js";
|
|
6
|
+
import { is as B, isArray as D, isBoolean as I, isClient as O, isDate as y, isDef as w, isEdgeBrowser as L, isElement as v, isEmail as C, isEmpty as F, isFunction as G, isHtmlStr as R, isInMobileBrowser as W, isIp as q, isMap as M, isNull as V, isNullAndUnDef as j, isNullOrUnDef as H, isNumber as Z, isObject as k, isPromise as z, isPromiseLink as J, isRegExp as K, isServer as Q, isString as X, isUnDef as Y, isUrl as _, isValidPhoneNumber as $, isWindow as ee, isZhLang as se } from "./utils/is.js";
|
|
7
|
+
import { BigNumber as ie, DOWN as re, UP as oe, add as ae, divide as le, formatRate as me, helper as ne, isBigNum as ue, isBool as pe, isEqualTo as ge, isGreaterThan as fe, isGreaterThanOrEqualTo as he, isInt as Ne, isLessThan as de, isLessThanOrEqualTo as Te, isNanValue as Ue, isNum as ce, multiply as xe, power as be, subtract as Ee, toBigNum as Pe, toDecimalPlaces as Se, toInt as Ae, toLocaleString as Be, toNum as De, toString as Ie, unFormatRate as Oe } from "./utils/math.js";
|
|
8
|
+
import { propTypes as we } from "./utils/vuePropTypes.js";
|
|
9
|
+
import { timeZoneOptions as ve } from "./utils/timeZone.js";
|
|
10
|
+
import { withInstall as Fe } from "./utils/withInstall.js";
|
|
11
|
+
const r = {
|
|
12
12
|
...e,
|
|
13
13
|
...s,
|
|
14
14
|
Utils: s,
|
|
15
15
|
Comps: e
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
ie as BigNumber,
|
|
19
|
+
re as DOWN,
|
|
20
20
|
c as GoogleAuth,
|
|
21
21
|
E as TelegramAuth,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
oe as UP,
|
|
23
|
+
ae as add,
|
|
24
|
+
l as deepMerge,
|
|
25
|
+
r as default,
|
|
26
|
+
m as desensitization,
|
|
27
|
+
le as divide,
|
|
28
28
|
n as evalPro,
|
|
29
29
|
u as filterInputNum,
|
|
30
|
-
|
|
30
|
+
me as formatRate,
|
|
31
31
|
p as generateFilterInputNumFn,
|
|
32
32
|
g as getRouterParams,
|
|
33
|
-
|
|
33
|
+
P as getTelegramAuthUrlParams,
|
|
34
34
|
f as getWebsiteUrl,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
ne as helper,
|
|
36
|
+
B as is,
|
|
37
|
+
D as isArray,
|
|
38
|
+
ue as isBigNum,
|
|
39
|
+
pe as isBool,
|
|
40
|
+
I as isBoolean,
|
|
41
|
+
O as isClient,
|
|
42
|
+
y as isDate,
|
|
43
|
+
w as isDef,
|
|
44
|
+
L as isEdgeBrowser,
|
|
45
|
+
v as isElement,
|
|
46
|
+
C as isEmail,
|
|
47
|
+
F as isEmpty,
|
|
48
|
+
ge as isEqualTo,
|
|
49
|
+
G as isFunction,
|
|
50
|
+
fe as isGreaterThan,
|
|
51
|
+
he as isGreaterThanOrEqualTo,
|
|
52
|
+
R as isHtmlStr,
|
|
53
|
+
W as isInMobileBrowser,
|
|
54
|
+
Ne as isInt,
|
|
55
|
+
q as isIp,
|
|
56
|
+
de as isLessThan,
|
|
57
|
+
Te as isLessThanOrEqualTo,
|
|
58
|
+
M as isMap,
|
|
59
|
+
Ue as isNanValue,
|
|
60
|
+
V as isNull,
|
|
61
|
+
j as isNullAndUnDef,
|
|
62
|
+
H as isNullOrUnDef,
|
|
63
63
|
ce as isNum,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
Z as isNumber,
|
|
65
|
+
k as isObject,
|
|
66
|
+
z as isPromise,
|
|
67
|
+
J as isPromiseLink,
|
|
68
|
+
K as isRegExp,
|
|
69
|
+
Q as isServer,
|
|
70
|
+
X as isString,
|
|
71
|
+
Y as isUnDef,
|
|
72
|
+
_ as isUrl,
|
|
73
|
+
$ as isValidPhoneNumber,
|
|
74
|
+
ee as isWindow,
|
|
75
|
+
se as isZhLang,
|
|
76
|
+
xe as multiply,
|
|
77
|
+
be as power,
|
|
78
|
+
we as propTypes,
|
|
79
79
|
h as removeWhitespace,
|
|
80
80
|
N as renderHtmlStr,
|
|
81
81
|
Ee as subtract,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
ve as timeZoneOptions,
|
|
83
|
+
Pe as toBigNum,
|
|
84
|
+
Se as toDecimalPlaces,
|
|
85
|
+
x as toGoogleAuth,
|
|
86
|
+
Ae as toInt,
|
|
87
|
+
Be as toLocaleString,
|
|
88
|
+
De as toNum,
|
|
89
|
+
Ie as toString,
|
|
90
|
+
d as toStyleObject,
|
|
91
|
+
T as toStyleUnit,
|
|
92
|
+
S as toTelegramAuth,
|
|
93
|
+
Oe as unFormatRate,
|
|
94
|
+
Fe as withInstall
|
|
93
95
|
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare function filterInputNum(eventVal: string | number, type?: 'int' |
|
|
|
18
18
|
* @param type 输入类型,int整数,float,default: 'int'
|
|
19
19
|
* @param maxDecimal 最大小数位,default: 6
|
|
20
20
|
*/
|
|
21
|
-
export declare function generateFilterInputNumFn<T extends
|
|
21
|
+
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;
|
|
22
22
|
/** 渲染Html字符串片段 */
|
|
23
23
|
export declare function renderHtmlStr(html: string): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
24
24
|
[key: string]: any;
|
|
@@ -45,3 +45,10 @@ export declare function desensitization(str?: string | number, number?: number,
|
|
|
45
45
|
showSuffix?: boolean;
|
|
46
46
|
middleStr?: string;
|
|
47
47
|
}): string | undefined;
|
|
48
|
+
/** 数字转为样式单位
|
|
49
|
+
* @param str 值
|
|
50
|
+
* @param unit 单位,default: 'px'
|
|
51
|
+
*/
|
|
52
|
+
export declare function toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
|
|
53
|
+
/** 数字转为样式对象 */
|
|
54
|
+
export declare function toStyleObject(style?: string | Recordable | null): Recordable<any>;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import { is as
|
|
3
|
-
import { BigNumber as R, DOWN as W, UP as q, add as M, divide as
|
|
2
|
+
import { is as t, isArray as r, 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 S, isNumber as T, isObject as x, isPromise as B, isPromiseLink as D, isRegExp as I, isServer as O, isString as P, isUnDef as U, isUrl as y, isValidPhoneNumber as w, isWindow as L, isZhLang as v } from "./is.js";
|
|
3
|
+
import { BigNumber as R, DOWN as W, UP as q, add as M, divide as j, formatRate as A, helper as G, isBigNum as H, isBool as V, isEqualTo as Z, 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 te, toNum as re, toString as oe, unFormatRate as ae } from "./math.js";
|
|
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
|
|
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-BE5vnR2C.js";
|
|
8
8
|
export {
|
|
9
9
|
R as BigNumber,
|
|
10
10
|
W as DOWN,
|
|
@@ -12,18 +12,18 @@ export {
|
|
|
12
12
|
M as add,
|
|
13
13
|
fe as deepMerge,
|
|
14
14
|
de as desensitization,
|
|
15
|
-
|
|
15
|
+
j as divide,
|
|
16
16
|
he as evalPro,
|
|
17
17
|
be as filterInputNum,
|
|
18
|
-
|
|
18
|
+
A as formatRate,
|
|
19
19
|
ce as generateFilterInputNumFn,
|
|
20
20
|
Ee as getRouterParams,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Se as getWebsiteUrl,
|
|
22
|
+
G as helper,
|
|
23
|
+
t as is,
|
|
24
|
+
r as isArray,
|
|
25
|
+
H as isBigNum,
|
|
26
|
+
V as isBool,
|
|
27
27
|
o as isBoolean,
|
|
28
28
|
a as isClient,
|
|
29
29
|
n as isDate,
|
|
@@ -32,7 +32,7 @@ export {
|
|
|
32
32
|
u as isElement,
|
|
33
33
|
p as isEmail,
|
|
34
34
|
g as isEmpty,
|
|
35
|
-
|
|
35
|
+
Z as isEqualTo,
|
|
36
36
|
N as isFunction,
|
|
37
37
|
k as isGreaterThan,
|
|
38
38
|
z as isGreaterThanOrEqualTo,
|
|
@@ -46,33 +46,35 @@ export {
|
|
|
46
46
|
Q as isNanValue,
|
|
47
47
|
c as isNull,
|
|
48
48
|
E as isNullAndUnDef,
|
|
49
|
-
|
|
49
|
+
S as isNullOrUnDef,
|
|
50
50
|
X as isNum,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
T as isNumber,
|
|
52
|
+
x as isObject,
|
|
53
|
+
B as isPromise,
|
|
54
|
+
D as isPromiseLink,
|
|
55
|
+
I as isRegExp,
|
|
56
56
|
O as isServer,
|
|
57
|
-
|
|
57
|
+
P as isString,
|
|
58
58
|
U as isUnDef,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
y as isUrl,
|
|
60
|
+
w as isValidPhoneNumber,
|
|
61
|
+
L as isWindow,
|
|
62
|
+
v as isZhLang,
|
|
63
63
|
Y as multiply,
|
|
64
64
|
_ as power,
|
|
65
65
|
le as propTypes,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
Te as removeWhitespace,
|
|
67
|
+
xe as renderHtmlStr,
|
|
68
68
|
$ as subtract,
|
|
69
69
|
ue as timeZoneOptions,
|
|
70
70
|
ee as toBigNum,
|
|
71
71
|
ie as toDecimalPlaces,
|
|
72
72
|
se as toInt,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
te as toLocaleString,
|
|
74
|
+
re as toNum,
|
|
75
75
|
oe as toString,
|
|
76
|
+
Be as toStyleObject,
|
|
77
|
+
De as toStyleUnit,
|
|
76
78
|
ae as unFormatRate,
|
|
77
79
|
ge as withInstall
|
|
78
80
|
};
|
package/package.json
CHANGED
|
@@ -1,157 +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 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
|
-
};
|