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.
@@ -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-BPap5bmS.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
@@ -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-BPap5bmS.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 d } from "./chunks/index-BPap5bmS.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
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 I, isArray as P, isBoolean as B, isClient as D, isDate as S, isDef as w, isEdgeBrowser as L, isElement as O, isEmail as v, isEmpty as y, isFunction as F, isHtmlStr as G, isInMobileBrowser as R, isIp as q, isMap as C, isNull as M, isNullAndUnDef as V, isNullOrUnDef as W, 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 { add as se, divide as ie, formatRate as re, helper as te, isBigNum as oe, isBool as ae, isEqualTo as le, isGreaterThan as me, isGreaterThanOrEqualTo as ne, isInt as ue, isLessThan as pe, isLessThanOrEqualTo as ge, isNanValue as fe, isNum as he, multiply as de, power as Ne, subtract as ce, toBigNum as Te, toDecimalPlaces as xe, toInt as Ee, toLocaleString as Ue, toNum as be, toString as Ae, unFormatRate as Ie } from "./utils/math.js";
8
- import { propTypes as Be } from "./utils/vuePropTypes.js";
9
- import { timeZoneOptions as Se } from "./utils/timeZone.js";
10
- import { withInstall as Le } from "./utils/withInstall.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";
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
- se as add,
21
- l as deepMerge,
22
+ re as UP,
23
+ te as add,
24
+ m as deepMerge,
22
25
  t as default,
23
- m as desensitization,
24
- ie as divide,
26
+ l as desensitization,
27
+ oe as divide,
25
28
  n as evalPro,
26
29
  u as filterInputNum,
27
- re as formatRate,
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
- te as helper,
33
- I as is,
34
- P as isArray,
35
- oe as isBigNum,
36
- ae as isBool,
37
- B as isBoolean,
38
- D as isClient,
39
- S as isDate,
40
- w as isDef,
41
- L as isEdgeBrowser,
42
- O as isElement,
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
- le as isEqualTo,
48
+ ue as isEqualTo,
46
49
  F as isFunction,
47
- me as isGreaterThan,
48
- ne as isGreaterThanOrEqualTo,
50
+ pe as isGreaterThan,
51
+ ge as isGreaterThanOrEqualTo,
49
52
  G as isHtmlStr,
50
53
  R as isInMobileBrowser,
51
- ue as isInt,
52
- q as isIp,
53
- pe as isLessThan,
54
- ge as isLessThanOrEqualTo,
55
- C as isMap,
56
- fe as isNanValue,
57
- M as isNull,
58
- V as isNullAndUnDef,
59
- W as isNullOrUnDef,
60
- he as isNum,
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
- de as multiply,
74
- Ne as power,
75
- Be as propTypes,
76
+ Te as multiply,
77
+ xe as power,
78
+ Se as propTypes,
76
79
  h as removeWhitespace,
77
- d as renderHtmlStr,
78
- ce as subtract,
79
- Se as timeZoneOptions,
80
- Te as toBigNum,
81
- xe as toDecimalPlaces,
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
- Ee as toInt,
84
- Ue as toLocaleString,
85
- be as toNum,
86
- Ae as toString,
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
- Le as withInstall
92
+ ye as withInstall
90
93
  };
@@ -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 p, isEmail as u, isEmpty as f, isFunction as g, isHtmlStr as d, isInMobileBrowser as N, isIp as h, isMap as c, isNull as E, isNullAndUnDef as T, isNullOrUnDef as b, isNumber as x, isObject as I, isPromise as B, isPromiseLink as D, isRegExp as P, isServer as S, isString as w, isUnDef as L, isUrl as O, isValidPhoneNumber as U, isWindow as v, isZhLang as y } from "./is.js";
3
- import { add as R, divide as q, formatRate as M, helper as W, isBigNum as A, isBool as G, isEqualTo as H, isGreaterThan as V, isGreaterThanOrEqualTo as Z, isInt as j, isLessThan as k, isLessThanOrEqualTo as z, isNanValue as C, isNum as J, multiply as K, power as Q, subtract as X, toBigNum as Y, toDecimalPlaces as _, toInt as $, toLocaleString as ee, toNum as ie, toString as se, unFormatRate as re } from "./math.js";
4
- import { propTypes as oe } from "./vuePropTypes.js";
5
- import { timeZoneOptions as ne } from "./timeZone.js";
6
- import { withInstall as me } from "./withInstall.js";
7
- import { d as ue, h as fe, e as ge, f as de, g as Ne, b as he, a as ce, c as Ee, r as Te } from "../chunks/index-BPap5bmS.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";
8
8
  export {
9
- R as add,
10
- ue as deepMerge,
11
- fe as desensitization,
12
- q as divide,
13
- ge as evalPro,
14
- de as filterInputNum,
15
- M as formatRate,
16
- Ne as generateFilterInputNumFn,
17
- he as getRouterParams,
18
- ce as getWebsiteUrl,
19
- W as helper,
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
- A as isBigNum,
23
- G as isBool,
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
- p as isElement,
30
- u as isEmail,
31
- f as isEmpty,
32
- H as isEqualTo,
33
- g as isFunction,
34
- V as isGreaterThan,
35
- Z as isGreaterThanOrEqualTo,
36
- d as isHtmlStr,
37
- N as isInMobileBrowser,
38
- j as isInt,
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
- k as isLessThan,
41
- z as isLessThanOrEqualTo,
42
- c as isMap,
43
- C as isNanValue,
44
- E as isNull,
45
- T as isNullAndUnDef,
46
- b as isNullOrUnDef,
47
- J as isNum,
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
- I as isObject,
50
- B as isPromise,
51
- D as isPromiseLink,
52
+ B as isObject,
53
+ D as isPromise,
54
+ I as isPromiseLink,
52
55
  P as isRegExp,
53
- S as isServer,
54
- w as isString,
55
- L as isUnDef,
56
- O as isUrl,
57
- U as isValidPhoneNumber,
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
- K as multiply,
61
- Q as power,
62
- oe as propTypes,
63
- Ee as removeWhitespace,
64
- Te as renderHtmlStr,
65
- X as subtract,
66
- ne as timeZoneOptions,
67
- Y as toBigNum,
68
- _ as toDecimalPlaces,
69
- $ as toInt,
70
- ee as toLocaleString,
71
- ie as toNum,
72
- se as toString,
73
- re as unFormatRate,
74
- me as withInstall
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
  };
@@ -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;
@@ -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, X, ie, F = s.s == t.s ? 1 : -1, U = s.c, I = t.c;
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, X = I.length, o = 0, F += 2, N = $(i / (I[0] + 1)), N > 1 && (I = e(I, N, i), U = e(U, N, i), X = I.length, ae = U.length), te = X, A = U.slice(0, X), _ = A.length; _ < X; A[_++] = 0)
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, X, _), f < 0) {
281
- if (v = A[0], X != _ && (v = v * i + (A[1] || 0)), N = $(v / he), N > 1)
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, X < T ? ie : I, T, i), T = m.length, f = 1;
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, X, _) < 1; )
288
- N++, n(A, X < _ ? ie : I, _, i), _ = A.length;
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 W = Ee();
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 W(~~a);
701
+ return X(~~a);
701
702
  if (!a)
702
- return W(0);
703
+ return X(0);
703
704
  if (Se(a))
704
- return a.isNaN() ? W(0) : a;
705
- const p = W(a);
706
- return p.isNaN() ? W(0) : p;
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 W.isBigNumber(a);
713
+ return X.isBigNumber(a);
713
714
  }
714
- function De(a) {
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 : W(a).isNaN();
719
+ return a == null || a == null ? !1 : X(a).isNaN();
719
720
  }
720
- function Ie(a) {
721
- return a == null || a == null ? !1 : W(a).isInteger();
721
+ function Pe(a) {
722
+ return a == null || a == null ? !1 : X(a).isInteger();
722
723
  }
723
- function Oe(a, p) {
724
+ function Ae(a, p) {
724
725
  return x(a).isGreaterThan(x(p));
725
726
  }
726
- function Pe(a, p) {
727
+ function Le(a, p) {
727
728
  return x(a).isLessThan(x(p));
728
729
  }
729
- function Le(a, p) {
730
+ function Me(a, p) {
730
731
  return x(a).isEqualTo(x(p));
731
732
  }
732
- function Me(a, p) {
733
+ function ve(a, p) {
733
734
  return x(a).isGreaterThanOrEqualTo(x(p));
734
735
  }
735
- function ve(a, p) {
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 Ue(a, p = !1) {
746
- return re(x(a).integerValue(p ? Ae : de));
745
+ function Ce(a, p = !1) {
746
+ return re(x(a).integerValue(p ? de : Oe));
747
747
  }
748
- function Ce(a) {
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 ? Ae : de) : O);
753
+ return re(p !== void 0 ? O.decimalPlaces(p, d ? de : Oe) : O);
754
754
  }
755
- function Ge(a) {
755
+ function ke(a) {
756
756
  return x(a).toFormat();
757
757
  }
758
- function ke(...a) {
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 qe(...a) {
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 Fe(...a) {
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 ye(...a) {
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 $e(a, p) {
782
+ function ze(a, p) {
783
783
  return re(x(a).pow(x(p)));
784
784
  }
785
- function ze(a, p = "%") {
785
+ function He(a, p = "%") {
786
786
  const d = x(a).times(100);
787
- return `${Oe(d, 0) ? Te(d, 2) : 0}${p}`;
787
+ return `${Ae(d, 0) ? Te(d, 2) : 0}${p}`;
788
788
  }
789
- function He(a) {
789
+ function Ve(a) {
790
790
  const p = x(a).div(100);
791
- return Oe(p, 0) ? Te(p, 4) : 0;
791
+ return Ae(p, 0) ? Te(p, 4) : 0;
792
792
  }
793
793
  export {
794
- ke as add,
795
- ye as divide,
796
- ze as formatRate,
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
- Le as isEqualTo,
801
- Oe as isGreaterThan,
802
- Me as isGreaterThanOrEqualTo,
803
- Ie as isInt,
804
- Pe as isLessThan,
805
- ve as isLessThanOrEqualTo,
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
- De as isNum,
808
- Fe as multiply,
809
- $e as power,
810
- qe as subtract,
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
- Ue as toInt,
814
- Ge as toLocaleString,
816
+ Ce as toInt,
817
+ ke as toLocaleString,
815
818
  re as toNum,
816
- Ce as toString,
817
- He as unFormatRate
819
+ Ge as toString,
820
+ Ve as unFormatRate
818
821
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jk-vue-comps",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "jk-vue-comps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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
- };