jk-vue-comps 0.1.7 → 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.
@@ -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,7 @@
1
1
  import { defineComponent as g, ref as p, onMounted as h, createVNode as C } from "vue";
2
2
  import { propTypes as f } from "../utils/vuePropTypes.js";
3
3
  import { isEdgeBrowser as w, isInMobileBrowser as _ } from "../utils/is.js";
4
+ import "../utils/math.js";
4
5
  import { withInstall as b } from "../utils/withInstall.js";
5
6
  function v(o, r) {
6
7
  if (!o || !r)
@@ -62,9 +63,9 @@ const I = /* @__PURE__ */ g({
62
63
  }))]);
63
64
  };
64
65
  }
65
- }), R = b(I);
66
+ }), j = b(I);
66
67
  export {
67
- R as GoogleAuth,
68
- R as default,
68
+ j as GoogleAuth,
69
+ j as default,
69
70
  v as toGoogleAuth
70
71
  };
@@ -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-C_baUQWz.js";
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
@@ -19,7 +19,7 @@ declare const JKVUEComps: {
19
19
  showPrefix?: boolean | undefined;
20
20
  showSuffix?: boolean | undefined;
21
21
  middleStr?: string | undefined;
22
- }): string | number | undefined;
22
+ }): string | undefined;
23
23
  is(val: unknown, type: string): boolean;
24
24
  isDef<T_2 = unknown>(val?: T_2 | undefined): val is T_2;
25
25
  isUnDef<T_3 = unknown>(val?: T_3 | undefined): val is T_3;
@@ -50,6 +50,33 @@ declare const JKVUEComps: {
50
50
  isIp: (ip: string) => boolean;
51
51
  isEmail: (email: string) => boolean;
52
52
  isHtmlStr: (str: string) => boolean;
53
+ helper(val: utils.BigNumValType): import("bignumber.js").BigNumber;
54
+ isBool(val: any): val is boolean;
55
+ isBigNum(val: any): val is import("bignumber.js").BigNumber;
56
+ isNum(val: any): val is number;
57
+ isNanValue(val: any): boolean;
58
+ isInt(val: any): boolean;
59
+ isGreaterThan(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
60
+ isLessThan(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
61
+ isEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
62
+ isGreaterThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
63
+ isLessThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
64
+ toBigNum(val: utils.BigNumValType): import("bignumber.js").BigNumber;
65
+ toNum(val: utils.BigNumValType): number;
66
+ toInt(val: utils.BigNumValType, isUp?: boolean): number;
67
+ toString(val: utils.BigNumValType): string;
68
+ toDecimalPlaces(val: utils.BigNumValType, decimal?: number | undefined, isUp?: boolean): number;
69
+ toLocaleString(val: utils.BigNumValType): string;
70
+ add(...vals: utils.BigNumValType[]): number;
71
+ subtract(...vals: utils.BigNumValType[]): number;
72
+ multiply(...vals: utils.BigNumValType[]): number;
73
+ divide(...vals: utils.BigNumValType[]): number;
74
+ power(base: utils.BigNumValType, exponent: utils.BigNumValType): number;
75
+ formatRate(val: utils.BigNumValType, unit?: string): string;
76
+ unFormatRate(val: utils.BigNumValType): number;
77
+ DOWN: 1;
78
+ UP: 0;
79
+ BigNumber: typeof import("bignumber.js").BigNumber;
53
80
  propTypes: typeof import("./utils/vuePropTypes").default;
54
81
  timeZoneOptions: utils.TimeZoneItem[];
55
82
  withInstall<T_7>(component: T_7, alias?: string | undefined): T_7 & import("vue").Plugin;
package/dist/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import { c as e } from "./chunks/index-BP9Q78TM.js";
2
- import { u as s } from "./chunks/index-C_baUQWz.js";
3
- import { d as m, h as l, e as n, f as p, g as u, b as f, a as g, c as h, r as d } from "./chunks/index-C_baUQWz.js";
4
- import { GoogleAuth as U, toGoogleAuth as c } from "./components/GoogleAuth.js";
5
- import { TelegramAuth as N, getTelegramAuthUrlParams as b, toTelegramAuth as E } from "./components/TelegramAuth.js";
6
- import { is as D, isArray as I, isBoolean as w, isClient as S, isDate as T, isDef as v, isEdgeBrowser as y, isElement as B, isEmail as C, isEmpty as F, isFunction as M, isHtmlStr as O, isInMobileBrowser as W, isIp as G, isMap as H, isNull as L, isNullAndUnDef as R, isNullOrUnDef as V, isNumber as Z, isObject as j, isPromise as k, isPromiseLink as z, isRegExp as J, isServer as K, isString as q, isUnDef as Q, isUrl as X, isValidPhoneNumber as Y, isWindow as _, isZhLang as $ } from "./utils/is.js";
7
- import { propTypes as se } from "./utils/vuePropTypes.js";
8
- import { timeZoneOptions as re } from "./utils/timeZone.js";
9
- import { withInstall as oe } from "./utils/withInstall.js";
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
+ import { GoogleAuth as c, toGoogleAuth as T } from "./components/GoogleAuth.js";
5
+ import { TelegramAuth as E, getTelegramAuthUrlParams as U, toTelegramAuth as b } from "./components/TelegramAuth.js";
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";
10
11
  const t = {
11
12
  ...e,
12
13
  ...s,
@@ -14,52 +15,79 @@ const t = {
14
15
  Comps: e
15
16
  };
16
17
  export {
17
- U as GoogleAuth,
18
- N as TelegramAuth,
18
+ se as BigNumber,
19
+ ie as DOWN,
20
+ c as GoogleAuth,
21
+ E as TelegramAuth,
22
+ re as UP,
23
+ te as add,
19
24
  m as deepMerge,
20
25
  t as default,
21
26
  l as desensitization,
27
+ oe as divide,
22
28
  n as evalPro,
23
- p as filterInputNum,
24
- u as generateFilterInputNumFn,
25
- f as getRouterParams,
26
- b as getTelegramAuthUrlParams,
27
- g as getWebsiteUrl,
28
- D as is,
29
- I as isArray,
30
- w as isBoolean,
31
- S as isClient,
32
- T as isDate,
33
- v as isDef,
34
- y as isEdgeBrowser,
35
- B as isElement,
36
- C as isEmail,
37
- F as isEmpty,
38
- M as isFunction,
39
- O as isHtmlStr,
40
- W as isInMobileBrowser,
41
- G as isIp,
42
- H as isMap,
43
- L as isNull,
44
- R as isNullAndUnDef,
29
+ u as filterInputNum,
30
+ ae as formatRate,
31
+ p as generateFilterInputNumFn,
32
+ g as getRouterParams,
33
+ U as getTelegramAuthUrlParams,
34
+ f as getWebsiteUrl,
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,
46
+ v as isEmail,
47
+ y as isEmpty,
48
+ ue as isEqualTo,
49
+ F as isFunction,
50
+ pe as isGreaterThan,
51
+ ge as isGreaterThanOrEqualTo,
52
+ G as isHtmlStr,
53
+ R as isInMobileBrowser,
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,
45
62
  V as isNullOrUnDef,
46
- Z as isNumber,
47
- j as isObject,
48
- k as isPromise,
49
- z as isPromiseLink,
50
- J as isRegExp,
51
- K as isServer,
52
- q as isString,
63
+ ce as isNum,
64
+ H as isNumber,
65
+ Z as isObject,
66
+ j as isPromise,
67
+ k as isPromiseLink,
68
+ z as isRegExp,
69
+ J as isServer,
70
+ K as isString,
53
71
  Q as isUnDef,
54
72
  X as isUrl,
55
73
  Y as isValidPhoneNumber,
56
74
  _ as isWindow,
57
75
  $ as isZhLang,
58
- se as propTypes,
76
+ Te as multiply,
77
+ xe as power,
78
+ Se as propTypes,
59
79
  h as removeWhitespace,
60
- d as renderHtmlStr,
61
- re as timeZoneOptions,
62
- c as toGoogleAuth,
63
- E as toTelegramAuth,
64
- oe as withInstall
80
+ N as renderHtmlStr,
81
+ Ee as subtract,
82
+ Le as timeZoneOptions,
83
+ Ue as toBigNum,
84
+ be as toDecimalPlaces,
85
+ T as toGoogleAuth,
86
+ Pe as toInt,
87
+ Ae as toLocaleString,
88
+ Be as toNum,
89
+ De as toString,
90
+ b as toTelegramAuth,
91
+ Ie as unFormatRate,
92
+ ye as withInstall
65
93
  };
@@ -1,4 +1,5 @@
1
1
  export * from './is';
2
+ export * from './math';
2
3
  export * from './vuePropTypes';
3
4
  export * from './timeZone';
4
5
  export * from './withInstall';
@@ -43,4 +44,4 @@ export declare function desensitization(str?: string | number, number?: number,
43
44
  showPrefix?: boolean;
44
45
  showSuffix?: boolean;
45
46
  middleStr?: string;
46
- }): string | number | undefined;
47
+ }): string | undefined;
@@ -1,50 +1,78 @@
1
1
  import "vue";
2
- import { is as r, isArray as t, isBoolean as o, isClient as n, isDate as a, isDef as l, isEdgeBrowser as m, isElement as p, isEmail as f, isEmpty as u, isFunction as g, isHtmlStr as d, isInMobileBrowser as N, isIp as b, isMap as x, isNull as h, isNullAndUnDef as D, isNullOrUnDef as E, isNumber as I, isObject as P, isPromise as U, isPromiseLink as c, isRegExp as w, isServer as S, isString as v, isUnDef as y, isUrl as B, isValidPhoneNumber as F, isWindow as M, isZhLang as O } from "./is.js";
3
- import { propTypes as A } from "./vuePropTypes.js";
4
- import { timeZoneOptions as L } from "./timeZone.js";
5
- import { withInstall as Z } from "./withInstall.js";
6
- import { d as k, h as z, e as C, f as T, g as V, b as q, a as G, c as J, r as K } from "../chunks/index-C_baUQWz.js";
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";
7
8
  export {
8
- k as deepMerge,
9
- z as desensitization,
10
- C as evalPro,
11
- T as filterInputNum,
12
- V as generateFilterInputNumFn,
13
- q as getRouterParams,
14
- G as getWebsiteUrl,
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,
15
23
  r as is,
16
24
  t as isArray,
25
+ V as isBigNum,
26
+ Z as isBool,
17
27
  o as isBoolean,
18
- n as isClient,
19
- a as isDate,
28
+ a as isClient,
29
+ n as isDate,
20
30
  l as isDef,
21
31
  m as isEdgeBrowser,
22
- p as isElement,
23
- f as isEmail,
24
- u as isEmpty,
25
- g as isFunction,
26
- d as isHtmlStr,
27
- N as isInMobileBrowser,
28
- b as isIp,
29
- x as isMap,
30
- h as isNull,
31
- D as isNullAndUnDef,
32
- E as isNullOrUnDef,
33
- I as isNumber,
34
- P as isObject,
35
- U as isPromise,
36
- c as isPromiseLink,
37
- w as isRegExp,
38
- S as isServer,
39
- v as isString,
40
- y as isUnDef,
41
- B as isUrl,
42
- F as isValidPhoneNumber,
43
- M as isWindow,
44
- O as isZhLang,
45
- A as propTypes,
46
- J as removeWhitespace,
47
- K as renderHtmlStr,
48
- L as timeZoneOptions,
49
- Z as withInstall
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,
42
+ h as isIp,
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,
51
+ x as isNumber,
52
+ B as isObject,
53
+ D as isPromise,
54
+ I as isPromiseLink,
55
+ P as isRegExp,
56
+ O as isServer,
57
+ S as isString,
58
+ U as isUnDef,
59
+ w as isUrl,
60
+ L as isValidPhoneNumber,
61
+ v as isWindow,
62
+ y as isZhLang,
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
50
78
  };
@@ -0,0 +1,107 @@
1
+ import BJS from 'bignumber.js';
2
+ export type BigNumVal = Parameters<typeof BJS>[0];
3
+ export type BigNumValType = BigNumVal | undefined | null | boolean;
4
+ export type BigNumObj = BJS;
5
+ export declare const DOWN: 1;
6
+ export declare const UP: 0;
7
+ export declare const BigNumber: typeof BJS;
8
+ export declare function helper(val: BigNumValType): BigNumObj;
9
+ /** 是否为boolean值 */
10
+ export declare function isBool(val: any): val is boolean;
11
+ /** 是否为BigNumber对象 */
12
+ export declare function isBigNum(val: any): val is BigNumObj;
13
+ /** 是否为数字 */
14
+ export declare function isNum(val: any): val is number;
15
+ /** 是否为NaN值(传入任意值转bignumber是否为NaN) */
16
+ export declare function isNanValue(val: any): boolean;
17
+ /** 是否为整数(传入任意值转bignumber是否为整数) */
18
+ export declare function isInt(val: any): boolean;
19
+ /** 是否大于
20
+ * @example isGreaterThan('456', 132) => true
21
+ */
22
+ export declare function isGreaterThan(num1: BigNumVal, num2: BigNumVal): boolean;
23
+ /** 是否小于
24
+ * @example isLessThan('123', 132) => true
25
+ */
26
+ export declare function isLessThan(num1: BigNumVal, num2: BigNumVal): boolean;
27
+ /** 是否等于
28
+ * @example isEqualTo('123', 123) => true
29
+ */
30
+ export declare function isEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
31
+ /** 是否大于等于
32
+ * @example isGreaterThanOrEqualTo('1223', 123) => true
33
+ * @example isGreaterThanOrEqualTo('123', 123) => true
34
+ */
35
+ export declare function isGreaterThanOrEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
36
+ /** 是否小于等于
37
+ * @example isLessThanOrEqualTo('123', 123) => true
38
+ * @example isLessThanOrEqualTo('13', 123) => true
39
+ */
40
+ export declare function isLessThanOrEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
41
+ /** 转为BigNumber对象 */
42
+ export declare function toBigNum(val: BigNumValType): BJS;
43
+ /** 转为数字 */
44
+ export declare function toNum(val: BigNumValType): number;
45
+ /**
46
+ * 转为整数
47
+ * @example toInt(15.99) => 15
48
+ * @example toInt(-22.22) => -22
49
+ */
50
+ export declare function toInt(val: BigNumValType, isUp?: boolean): number;
51
+ /** 转为字符串 */
52
+ export declare function toString(val: BigNumValType): string;
53
+ /**
54
+ * 保留小数位(超过指定位数截断,小于位数不进行0补充)
55
+ * @param val val
56
+ * @param decimal 保留小数位数
57
+ * @param isUp 是否向上舍入 default: false
58
+ * @example toDecimalPlaces(2.326, 2) => 2.32
59
+ * @example toDecimalPlaces(-5.526, 2) => -5.52
60
+ * @example toDecimalPlaces(2.326, 2, true) => 2.33
61
+ * @example toDecimalPlaces(-5.526, 2, true) => -5.53
62
+ */
63
+ export declare function toDecimalPlaces(val: BigNumValType, decimal?: number, isUp?: boolean): number;
64
+ /** 转为千位符数字 */
65
+ export declare function toLocaleString(val: BigNumValType): string;
66
+ /**
67
+ * 相加
68
+ * @example add(3, 3) => 6
69
+ * @example add(3, 3, 4) => 10
70
+ */
71
+ export declare function add(...vals: BigNumValType[]): number;
72
+ /**
73
+ * 相减
74
+ * @example subtract('5', 3) => 2
75
+ * @example subtract(5, 3, '2') => 0
76
+ */
77
+ export declare function subtract(...vals: BigNumValType[]): number;
78
+ /**
79
+ * 相乘
80
+ * @example multiply('3', 5) => 15
81
+ * @example multiply(3, 5, '2') => 30
82
+ */
83
+ export declare function multiply(...vals: BigNumValType[]): number;
84
+ /**
85
+ * 相除
86
+ * @example divide('9', 3) => 3
87
+ * @example divide('100', 2, 10) => 5
88
+ * @example divide('100', 0, 10) => 0
89
+ */
90
+ export declare function divide(...vals: BigNumValType[]): number;
91
+ /**
92
+ * 幂运算
93
+ * @example power('2', '3') => 8
94
+ * @example power('10', 2) => 100
95
+ * @example power('-2', 3) => -8
96
+ */
97
+ export declare function power(base: BigNumValType, exponent: BigNumValType): number;
98
+ /**
99
+ * 小数转为百分比
100
+ * @example 0.1111 => 11.11%
101
+ */
102
+ export declare function formatRate(val: BigNumValType, unit?: string): string;
103
+ /**
104
+ * 转为百分小数
105
+ * @example 22.22 => 0.2222
106
+ */
107
+ export declare function unFormatRate(val: BigNumValType): number;