jk-vue-comps 0.2.17 → 0.2.19
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/{math-Xp7OBfoD.js → bignumber-CC1ajqLP.js} +1 -86
- package/dist/index.js +2 -2
- package/dist/utils/index.js +60 -60
- package/dist/utils/lodash.js +59 -57
- package/dist/utils/math.js +87 -2
- package/package.json +2 -2
|
@@ -581,89 +581,4 @@ function y(e, t, n) {
|
|
|
581
581
|
return e;
|
|
582
582
|
}
|
|
583
583
|
//#endregion
|
|
584
|
-
|
|
585
|
-
var b = e.ROUND_DOWN, x = e.ROUND_UP, S = e;
|
|
586
|
-
function C(t) {
|
|
587
|
-
if (w(t)) return e(~~t);
|
|
588
|
-
if (!t) return e(0);
|
|
589
|
-
if (T(t)) return t.isNaN() ? e(0) : t;
|
|
590
|
-
let n = e(t);
|
|
591
|
-
return n.isNaN() ? e(0) : n;
|
|
592
|
-
}
|
|
593
|
-
function w(e) {
|
|
594
|
-
return typeof e == "boolean";
|
|
595
|
-
}
|
|
596
|
-
function T(t) {
|
|
597
|
-
return e.isBigNumber(t);
|
|
598
|
-
}
|
|
599
|
-
function E(e) {
|
|
600
|
-
return typeof e == "number" && !D(e);
|
|
601
|
-
}
|
|
602
|
-
function D(t) {
|
|
603
|
-
return t == null || t == null ? !1 : e(t).isNaN();
|
|
604
|
-
}
|
|
605
|
-
function O(t) {
|
|
606
|
-
return t == null || t == null ? !1 : e(t).isInteger();
|
|
607
|
-
}
|
|
608
|
-
function k(e, t) {
|
|
609
|
-
return C(e).isGreaterThan(C(t));
|
|
610
|
-
}
|
|
611
|
-
function A(e, t) {
|
|
612
|
-
return C(e).isLessThan(C(t));
|
|
613
|
-
}
|
|
614
|
-
function j(e, t) {
|
|
615
|
-
return C(e).isEqualTo(C(t));
|
|
616
|
-
}
|
|
617
|
-
function M(e, t) {
|
|
618
|
-
return C(e).isGreaterThanOrEqualTo(C(t));
|
|
619
|
-
}
|
|
620
|
-
function N(e, t) {
|
|
621
|
-
return C(e).isLessThanOrEqualTo(C(t));
|
|
622
|
-
}
|
|
623
|
-
function P(e) {
|
|
624
|
-
return C(e);
|
|
625
|
-
}
|
|
626
|
-
function F(e) {
|
|
627
|
-
return C(e).toNumber();
|
|
628
|
-
}
|
|
629
|
-
function I(e, t = !1) {
|
|
630
|
-
return F(C(e).integerValue(t ? x : b));
|
|
631
|
-
}
|
|
632
|
-
function L(e) {
|
|
633
|
-
return C(e).toString();
|
|
634
|
-
}
|
|
635
|
-
function R(e, t, n = !1) {
|
|
636
|
-
let r = C(e);
|
|
637
|
-
return F(t === void 0 ? r : r.decimalPlaces(t, n ? x : b));
|
|
638
|
-
}
|
|
639
|
-
function z(e) {
|
|
640
|
-
return C(e).toFormat();
|
|
641
|
-
}
|
|
642
|
-
function B(...e) {
|
|
643
|
-
return e.length === 0 ? 0 : F(e.reduce((e, t) => C(e).plus(C(t)), 0));
|
|
644
|
-
}
|
|
645
|
-
function V(...e) {
|
|
646
|
-
return e.length === 0 ? 0 : F(e.reduce((e, t) => C(e).minus(C(t))));
|
|
647
|
-
}
|
|
648
|
-
function H(...e) {
|
|
649
|
-
return e.length === 0 ? 0 : F(e.reduce((e, t) => C(e).times(C(t)), 1));
|
|
650
|
-
}
|
|
651
|
-
function U(...e) {
|
|
652
|
-
if (e.length === 0) return 0;
|
|
653
|
-
let t = e.map((e) => P(e));
|
|
654
|
-
return t.some((e) => e.isZero()) ? 0 : t.reduce((e, t) => e.dividedBy(t)).toNumber();
|
|
655
|
-
}
|
|
656
|
-
function W(e, t) {
|
|
657
|
-
return F(C(e).pow(C(t)));
|
|
658
|
-
}
|
|
659
|
-
function G(e, t = "%") {
|
|
660
|
-
let n = C(e).times(100);
|
|
661
|
-
return `${k(n, 0) ? R(n, 2) : 0}${t}`;
|
|
662
|
-
}
|
|
663
|
-
function K(e) {
|
|
664
|
-
let t = C(e).div(100);
|
|
665
|
-
return k(t, 0) ? R(t, 4) : 0;
|
|
666
|
-
}
|
|
667
|
-
var q = k, J = M, Y = A, X = N, Z = j, Q = D;
|
|
668
|
-
//#endregion
|
|
669
|
-
export { z as A, X as C, P as D, V as E, L as M, K as N, R as O, Y as S, W as T, A as _, U as a, D as b, q as c, T as d, w as f, O as g, M as h, B as i, F as j, I as k, J as l, k as m, b as n, Z as o, j as p, x as r, G as s, S as t, C as u, N as v, H as w, E as x, Q as y };
|
|
584
|
+
export { e as t };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { is as ee, isArray as e, isBoolean as te, isClient as ne, isDate as re, isDef as t, isEdgeBrowser as n, isElement as r, isEmail as i, isEmpty as a, isFunction as o, isHtmlStr as s, isInMobileBrowser as c, isIp as l, isMap as u, isNull as d, isNullAndUnDef as f, isNullOrUnDef as p, isNumber as m, isObject as h, isPromise as g, isPromiseLink as _, isRegExp as v, isServer as y, isString as b, isUnDef as x, isUrl as S, isValidPhoneNumber as C, isWindow as w, isZhLang as T } from "./utils/is.js";
|
|
2
|
-
import {
|
|
2
|
+
import { BigNumber as E, DOWN as D, UP as O, add as k, divide as A, eq as j, formatRate as M, gt as N, gte as P, helper as F, isBigNum as I, isBool as L, isEqualTo as R, isGreaterThan as z, isGreaterThanOrEqualTo as B, isInt as V, isLessThan as H, isLessThanOrEqualTo as U, isNan as W, isNanValue as G, isNum as K, lt as q, lte as J, multiply as Y, power as X, subtract as ie, toBigNum as ae, toDecimalPlaces as oe, toInt as se, toLocaleString as ce, toNum as le, toString as ue, unFormatRate as de } from "./utils/math.js";
|
|
3
3
|
import { propTypes as fe } from "./utils/vuePropTypes.js";
|
|
4
4
|
import { timeZoneOptions as pe } from "./utils/timeZone.js";
|
|
5
5
|
import { withInstall as me } from "./utils/withInstall.js";
|
|
@@ -21,4 +21,4 @@ var Fe = {
|
|
|
21
21
|
Utils: Z
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
|
-
export {
|
|
24
|
+
export { E as BigNumber, D as DOWN, Ee as GoogleAuth, Oe as TelegramAuth, O as UP, k as add, je as copyTextToClipboard, he as deepMerge, Fe as default, ge as desensitization, A as divide, j as eq, _e as evalPro, ve as filterInputNum, M as formatRate, ye as generateFilterInputNumFn, be as getRouterParams, ke as getTelegramAuthUrlParams, xe as getWebsiteUrl, N as gt, P as gte, F as helper, ee as is, e as isArray, I as isBigNum, L as isBool, te as isBoolean, ne as isClient, re as isDate, t as isDef, n as isEdgeBrowser, r as isElement, i as isEmail, a as isEmpty, R as isEqualTo, o as isFunction, z as isGreaterThan, B as isGreaterThanOrEqualTo, s as isHtmlStr, c as isInMobileBrowser, V as isInt, l as isIp, H as isLessThan, U as isLessThanOrEqualTo, u as isMap, W as isNan, G as isNanValue, d as isNull, f as isNullAndUnDef, p as isNullOrUnDef, K as isNum, m as isNumber, h as isObject, g as isPromise, _ as isPromiseLink, v as isRegExp, y as isServer, b as isString, x as isUnDef, S as isUrl, C as isValidPhoneNumber, w as isWindow, T as isZhLang, q as lt, J as lte, Y as multiply, X as power, fe as propTypes, Se as removeWhitespace, Ce as renderHtmlStr, ie as subtract, pe as timeZoneOptions, ae as toBigNum, oe as toDecimalPlaces, De as toGoogleAuth, se as toInt, ce as toLocaleString, le as toNum, ue as toString, we as toStyleObject, Te as toStyleUnit, Ae as toTelegramAuth, de as unFormatRate, Me as useCopyToClipboard, Ne as useFormKeypressEnter, Pe as useMemo, me as withInstall };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { t as e } from "../chunks/chunk-cBPL4W67.js";
|
|
2
|
-
import { is as t, isArray as n, isBoolean as r, isClient as i, isDate as a, isDef as o, isEdgeBrowser as s, isElement as c, isEmail as l, isEmpty as u, isFunction as d, isHtmlStr as f, isInMobileBrowser as
|
|
3
|
-
import {
|
|
2
|
+
import { is as t, isArray as n, isBoolean as r, isClient as i, isDate as a, isDef as o, isEdgeBrowser as s, isElement as c, isEmail as l, isEmpty as u, isFunction as d, isHtmlStr as f, isInMobileBrowser as ee, isIp as te, isMap as ne, isNull as re, isNullAndUnDef as p, isNullOrUnDef as m, isNumber as h, isObject as g, isPromise as _, isPromiseLink as v, isRegExp as y, isServer as b, isString as x, isUnDef as S, isUrl as C, isValidPhoneNumber as w, isWindow as T, isZhLang as E } from "./is.js";
|
|
3
|
+
import { BigNumber as D, DOWN as O, UP as k, add as A, divide as j, eq as M, formatRate as N, gt as P, gte as F, helper as I, isBigNum as L, isBool as R, isEqualTo as z, isGreaterThan as B, isGreaterThanOrEqualTo as V, isInt as H, isLessThan as U, isLessThanOrEqualTo as W, isNan as G, isNanValue as K, isNum as q, lt as J, lte as ie, multiply as Y, power as ae, subtract as oe, toBigNum as se, toDecimalPlaces as ce, toInt as le, toLocaleString as ue, toNum as X, toString as de, unFormatRate as fe } from "./math.js";
|
|
4
4
|
import { propTypes as pe } from "./vuePropTypes.js";
|
|
5
5
|
import { timeZoneOptions as me } from "./timeZone.js";
|
|
6
6
|
import { withInstall as he } from "./withInstall.js";
|
|
7
7
|
import { createVNode as ge, nextTick as _e } from "vue";
|
|
8
8
|
//#region src/utils/index.ts
|
|
9
9
|
var ve = /* @__PURE__ */ e({
|
|
10
|
-
BigNumber: () =>
|
|
11
|
-
DOWN: () =>
|
|
12
|
-
UP: () =>
|
|
13
|
-
add: () =>
|
|
10
|
+
BigNumber: () => D,
|
|
11
|
+
DOWN: () => O,
|
|
12
|
+
UP: () => k,
|
|
13
|
+
add: () => A,
|
|
14
14
|
deepMerge: () => $,
|
|
15
15
|
desensitization: () => we,
|
|
16
|
-
divide: () =>
|
|
17
|
-
eq: () =>
|
|
16
|
+
divide: () => j,
|
|
17
|
+
eq: () => M,
|
|
18
18
|
evalPro: () => ye,
|
|
19
19
|
filterInputNum: () => Z,
|
|
20
|
-
formatRate: () =>
|
|
20
|
+
formatRate: () => N,
|
|
21
21
|
generateFilterInputNumFn: () => be,
|
|
22
22
|
getRouterParams: () => Se,
|
|
23
23
|
getWebsiteUrl: () => Q,
|
|
24
|
-
gt: () =>
|
|
25
|
-
gte: () =>
|
|
26
|
-
helper: () =>
|
|
24
|
+
gt: () => P,
|
|
25
|
+
gte: () => F,
|
|
26
|
+
helper: () => I,
|
|
27
27
|
is: () => t,
|
|
28
28
|
isArray: () => n,
|
|
29
|
-
isBigNum: () =>
|
|
30
|
-
isBool: () =>
|
|
29
|
+
isBigNum: () => L,
|
|
30
|
+
isBool: () => R,
|
|
31
31
|
isBoolean: () => r,
|
|
32
32
|
isClient: () => i,
|
|
33
33
|
isDate: () => a,
|
|
@@ -36,53 +36,53 @@ var ve = /* @__PURE__ */ e({
|
|
|
36
36
|
isElement: () => c,
|
|
37
37
|
isEmail: () => l,
|
|
38
38
|
isEmpty: () => u,
|
|
39
|
-
isEqualTo: () =>
|
|
39
|
+
isEqualTo: () => z,
|
|
40
40
|
isFunction: () => d,
|
|
41
|
-
isGreaterThan: () =>
|
|
42
|
-
isGreaterThanOrEqualTo: () =>
|
|
41
|
+
isGreaterThan: () => B,
|
|
42
|
+
isGreaterThanOrEqualTo: () => V,
|
|
43
43
|
isHtmlStr: () => f,
|
|
44
|
-
isInMobileBrowser: () =>
|
|
45
|
-
isInt: () =>
|
|
46
|
-
isIp: () =>
|
|
47
|
-
isLessThan: () =>
|
|
48
|
-
isLessThanOrEqualTo: () =>
|
|
49
|
-
isMap: () =>
|
|
50
|
-
isNan: () =>
|
|
51
|
-
isNanValue: () =>
|
|
52
|
-
isNull: () =>
|
|
53
|
-
isNullAndUnDef: () =>
|
|
54
|
-
isNullOrUnDef: () =>
|
|
55
|
-
isNum: () =>
|
|
56
|
-
isNumber: () =>
|
|
57
|
-
isObject: () =>
|
|
58
|
-
isPromise: () =>
|
|
59
|
-
isPromiseLink: () =>
|
|
60
|
-
isRegExp: () =>
|
|
61
|
-
isServer: () =>
|
|
62
|
-
isString: () =>
|
|
63
|
-
isUnDef: () =>
|
|
64
|
-
isUrl: () =>
|
|
65
|
-
isValidPhoneNumber: () =>
|
|
66
|
-
isWindow: () =>
|
|
67
|
-
isZhLang: () =>
|
|
68
|
-
lt: () =>
|
|
69
|
-
lte: () =>
|
|
70
|
-
multiply: () =>
|
|
71
|
-
power: () =>
|
|
44
|
+
isInMobileBrowser: () => ee,
|
|
45
|
+
isInt: () => H,
|
|
46
|
+
isIp: () => te,
|
|
47
|
+
isLessThan: () => U,
|
|
48
|
+
isLessThanOrEqualTo: () => W,
|
|
49
|
+
isMap: () => ne,
|
|
50
|
+
isNan: () => G,
|
|
51
|
+
isNanValue: () => K,
|
|
52
|
+
isNull: () => re,
|
|
53
|
+
isNullAndUnDef: () => p,
|
|
54
|
+
isNullOrUnDef: () => m,
|
|
55
|
+
isNum: () => q,
|
|
56
|
+
isNumber: () => h,
|
|
57
|
+
isObject: () => g,
|
|
58
|
+
isPromise: () => _,
|
|
59
|
+
isPromiseLink: () => v,
|
|
60
|
+
isRegExp: () => y,
|
|
61
|
+
isServer: () => b,
|
|
62
|
+
isString: () => x,
|
|
63
|
+
isUnDef: () => S,
|
|
64
|
+
isUrl: () => C,
|
|
65
|
+
isValidPhoneNumber: () => w,
|
|
66
|
+
isWindow: () => T,
|
|
67
|
+
isZhLang: () => E,
|
|
68
|
+
lt: () => J,
|
|
69
|
+
lte: () => ie,
|
|
70
|
+
multiply: () => Y,
|
|
71
|
+
power: () => ae,
|
|
72
72
|
propTypes: () => pe,
|
|
73
73
|
removeWhitespace: () => Ce,
|
|
74
74
|
renderHtmlStr: () => xe,
|
|
75
|
-
subtract: () =>
|
|
75
|
+
subtract: () => oe,
|
|
76
76
|
timeZoneOptions: () => me,
|
|
77
|
-
toBigNum: () =>
|
|
78
|
-
toDecimalPlaces: () =>
|
|
79
|
-
toInt: () =>
|
|
80
|
-
toLocaleString: () =>
|
|
81
|
-
toNum: () =>
|
|
82
|
-
toString: () =>
|
|
77
|
+
toBigNum: () => se,
|
|
78
|
+
toDecimalPlaces: () => ce,
|
|
79
|
+
toInt: () => le,
|
|
80
|
+
toLocaleString: () => ue,
|
|
81
|
+
toNum: () => X,
|
|
82
|
+
toString: () => de,
|
|
83
83
|
toStyleObject: () => Ee,
|
|
84
84
|
toStyleUnit: () => Te,
|
|
85
|
-
unFormatRate: () =>
|
|
85
|
+
unFormatRate: () => fe,
|
|
86
86
|
withInstall: () => he
|
|
87
87
|
});
|
|
88
88
|
function ye(e) {
|
|
@@ -112,7 +112,7 @@ function be(e, t, n, r = "int", i = 6) {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
function xe(e) {
|
|
115
|
-
return !
|
|
115
|
+
return !x(e) || !f(e) ? e : ge("div", { innerHTML: e });
|
|
116
116
|
}
|
|
117
117
|
function Q() {
|
|
118
118
|
return window ? `${window.location.protocol}//${window.location.hostname}` : "";
|
|
@@ -125,23 +125,23 @@ function Se() {
|
|
|
125
125
|
return t;
|
|
126
126
|
}
|
|
127
127
|
function Ce(e) {
|
|
128
|
-
return
|
|
128
|
+
return x(e) ? e.replace(/\s+/g, "") : "";
|
|
129
129
|
}
|
|
130
130
|
function $(e = {}, t = {}) {
|
|
131
131
|
let n;
|
|
132
|
-
for (n in t) e[n] =
|
|
132
|
+
for (n in t) e[n] = g(e[n]) ? $(e[n], t[n]) : e[n] = t[n];
|
|
133
133
|
return e;
|
|
134
134
|
}
|
|
135
135
|
function we(e, t = 6, { showPrefix: n = !0, showSuffix: r = !0, middleStr: i = "****" } = {}) {
|
|
136
|
-
if (!
|
|
136
|
+
if (!x(e) && !h(e)) return e;
|
|
137
137
|
let a = String(e), o = a?.length ?? 0;
|
|
138
138
|
return !a || !o || t <= 0 ? a : `${n ? a.substring(0, t) : ""}${i}${r ? a.substring(o - t) : ""}`;
|
|
139
139
|
}
|
|
140
140
|
function Te(e, t = "px") {
|
|
141
|
-
if (!(e === null || e === "" || e === void 0)) return
|
|
141
|
+
if (!(e === null || e === "" || e === void 0)) return K(e) ? String(e) : `${X(e)}${t}`;
|
|
142
142
|
}
|
|
143
143
|
function Ee(e) {
|
|
144
|
-
return e ?
|
|
144
|
+
return e ? g(e) ? e : e.split(";").reduce((e, t) => {
|
|
145
145
|
let [n, r] = t.trim().split(":");
|
|
146
146
|
if (n) {
|
|
147
147
|
let t = n.trim().replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
|
|
@@ -151,4 +151,4 @@ function Ee(e) {
|
|
|
151
151
|
}, {}) : {};
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
-
export {
|
|
154
|
+
export { D as BigNumber, O as DOWN, k as UP, A as add, $ as deepMerge, we as desensitization, j as divide, M as eq, ye as evalPro, Z as filterInputNum, N as formatRate, be as generateFilterInputNumFn, Se as getRouterParams, Q as getWebsiteUrl, P as gt, F as gte, I as helper, t as is, n as isArray, L as isBigNum, R as isBool, r as isBoolean, i as isClient, a as isDate, o as isDef, s as isEdgeBrowser, c as isElement, l as isEmail, u as isEmpty, z as isEqualTo, d as isFunction, B as isGreaterThan, V as isGreaterThanOrEqualTo, f as isHtmlStr, ee as isInMobileBrowser, H as isInt, te as isIp, U as isLessThan, W as isLessThanOrEqualTo, ne as isMap, G as isNan, K as isNanValue, re as isNull, p as isNullAndUnDef, m as isNullOrUnDef, q as isNum, h as isNumber, g as isObject, _ as isPromise, v as isPromiseLink, y as isRegExp, b as isServer, x as isString, S as isUnDef, C as isUrl, w as isValidPhoneNumber, T as isWindow, E as isZhLang, J as lt, ie as lte, Y as multiply, ae as power, pe as propTypes, Ce as removeWhitespace, xe as renderHtmlStr, oe as subtract, ve as t, me as timeZoneOptions, se as toBigNum, ce as toDecimalPlaces, le as toInt, ue as toLocaleString, X as toNum, de as toString, Ee as toStyleObject, Te as toStyleUnit, fe as unFormatRate, he as withInstall };
|
package/dist/utils/lodash.js
CHANGED
|
@@ -1,71 +1,73 @@
|
|
|
1
|
+
import { t as e } from "../chunks/bignumber-CC1ajqLP.js";
|
|
1
2
|
//#region src/utils/lodash.ts
|
|
2
|
-
function e
|
|
3
|
-
if (typeof
|
|
4
|
-
let n =
|
|
5
|
-
return n?.__v_isRef && (n = n.value), n?.__v_raw && (n = n.__v_raw), n ===
|
|
6
|
-
}
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
if (typeof
|
|
10
|
-
if (
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
function t(e) {
|
|
4
|
+
if (typeof e != "object" || !e) return e;
|
|
5
|
+
let n = e;
|
|
6
|
+
return n?.__v_isRef && (n = n.value), n?.__v_raw && (n = n.__v_raw), n === e ? n : t(n);
|
|
7
|
+
}
|
|
8
|
+
function n(n) {
|
|
9
|
+
let r = t(n);
|
|
10
|
+
if (typeof r != "object" || !r) return r;
|
|
11
|
+
if (r.$d && typeof r.clone == "function") return r.clone();
|
|
12
|
+
if (e.isBigNumber(r)) return new r.constructor(r);
|
|
13
|
+
if (Array.isArray(r)) return [...r];
|
|
14
|
+
if (r instanceof Date) return new Date(r.getTime());
|
|
15
|
+
if (r instanceof RegExp) {
|
|
16
|
+
let e = new RegExp(r.source, r.flags);
|
|
17
|
+
return e.lastIndex = r.lastIndex, e;
|
|
15
18
|
}
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
function n
|
|
19
|
-
let
|
|
20
|
-
if (typeof
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
-
if (
|
|
24
|
-
if (
|
|
19
|
+
return r instanceof Map ? new Map(r) : r instanceof Set ? new Set(r) : Object.assign(Object.create(Object.getPrototypeOf(r)), r);
|
|
20
|
+
}
|
|
21
|
+
function r(n, i = /* @__PURE__ */ new WeakMap()) {
|
|
22
|
+
let a = t(n);
|
|
23
|
+
if (typeof a != "object" || !a) return a;
|
|
24
|
+
if (a.$d && typeof a.clone == "function") return a.clone();
|
|
25
|
+
if (e.isBigNumber(a)) return new a.constructor(a);
|
|
26
|
+
if (a instanceof Date) return new Date(a.getTime());
|
|
27
|
+
if (a instanceof RegExp) return new RegExp(a.source, a.flags);
|
|
28
|
+
if (i.has(a)) return i.get(a);
|
|
29
|
+
if (a instanceof Map) {
|
|
25
30
|
let e = /* @__PURE__ */ new Map();
|
|
26
|
-
return
|
|
31
|
+
return i.set(a, e), a.forEach((t, n) => e.set(r(n, i), r(t, i))), e;
|
|
27
32
|
}
|
|
28
|
-
if (
|
|
33
|
+
if (a instanceof Set) {
|
|
29
34
|
let e = /* @__PURE__ */ new Set();
|
|
30
|
-
return
|
|
35
|
+
return i.set(a, e), a.forEach((t) => e.add(r(t, i))), e;
|
|
31
36
|
}
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
let o = Array.isArray(i) ? void 0 : Object.keys(i);
|
|
38
|
-
return (o || i).forEach((e, t) => {
|
|
39
|
-
let s = o ? e : t;
|
|
37
|
+
let o;
|
|
38
|
+
o = Array.isArray(a) ? [] : Object.prototype.toString.call(a) === "[object Object]" ? {} : Object.create(Object.getPrototypeOf(a)), i.set(a, o);
|
|
39
|
+
let s = Array.isArray(a) ? void 0 : Object.keys(a);
|
|
40
|
+
return (s || a).forEach((e, t) => {
|
|
41
|
+
let n = s ? e : t;
|
|
40
42
|
try {
|
|
41
|
-
|
|
43
|
+
o[n] = r(a[n], i);
|
|
42
44
|
} catch (e) {
|
|
43
|
-
console.warn(`Property ${String(
|
|
45
|
+
console.warn(`Property ${String(n)} could not be cloned.`, e);
|
|
44
46
|
}
|
|
45
|
-
}),
|
|
47
|
+
}), o;
|
|
46
48
|
}
|
|
47
|
-
function
|
|
49
|
+
function i(e, t) {
|
|
48
50
|
let n = {};
|
|
49
51
|
if (e == null) return n;
|
|
50
52
|
let r = Array.isArray(t) ? t : [t];
|
|
51
53
|
for (let t of r) t in e && (n[t] = e[t]);
|
|
52
54
|
return n;
|
|
53
55
|
}
|
|
54
|
-
function
|
|
56
|
+
function a(e, t) {
|
|
55
57
|
let n = {};
|
|
56
58
|
return e == null || Object.keys(e).forEach((r) => {
|
|
57
59
|
let i = e[r];
|
|
58
60
|
t(i, r) && (n[r] = i);
|
|
59
61
|
}), n;
|
|
60
62
|
}
|
|
61
|
-
function
|
|
63
|
+
function o(e, t) {
|
|
62
64
|
if (typeof e != "object" || !e) return e;
|
|
63
65
|
if (t === void 0 || t === "" || Array.isArray(t) && !t.length) return { ...e };
|
|
64
66
|
let n = Array.isArray(t) ? t : [t], r = {}, i = Reflect.ownKeys(e);
|
|
65
67
|
for (let t of i) n.includes(t) || (r[t] = e[t]);
|
|
66
68
|
return r;
|
|
67
69
|
}
|
|
68
|
-
function
|
|
70
|
+
function s(e, t, n) {
|
|
69
71
|
if (e == null) return n;
|
|
70
72
|
if (!t) return e;
|
|
71
73
|
let r = t.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean), i = e;
|
|
@@ -75,7 +77,7 @@ function o(e, t, n) {
|
|
|
75
77
|
}
|
|
76
78
|
return i === void 0 ? n : i;
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function c(e, t, n) {
|
|
79
81
|
if (Object(e) !== e) return e;
|
|
80
82
|
let r = t.toString().replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean), i = e;
|
|
81
83
|
for (let e = 0; e < r.length - 1; e++) {
|
|
@@ -89,10 +91,10 @@ function s(e, t, n) {
|
|
|
89
91
|
let a = r[r.length - 1];
|
|
90
92
|
return i[a] = n, e;
|
|
91
93
|
}
|
|
92
|
-
function
|
|
94
|
+
function l(e) {
|
|
93
95
|
return e == null;
|
|
94
96
|
}
|
|
95
|
-
function
|
|
97
|
+
function u(e, t) {
|
|
96
98
|
if (e === t || typeof e == "number" && typeof t == "number" && isNaN(e) && isNaN(t)) return !0;
|
|
97
99
|
if (typeof e != "object" || !e || typeof t != "object" || !t || Object.prototype.toString.call(e) !== Object.prototype.toString.call(t)) return !1;
|
|
98
100
|
if (e instanceof Date) return e.getTime() === t.getTime();
|
|
@@ -101,18 +103,18 @@ function l(e, t) {
|
|
|
101
103
|
if (n !== Array.isArray(t)) return !1;
|
|
102
104
|
if (n) {
|
|
103
105
|
if (e.length !== t.length) return !1;
|
|
104
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
106
|
+
for (let n = 0; n < e.length; n++) if (!u(e[n], t[n])) return !1;
|
|
105
107
|
return !0;
|
|
106
108
|
}
|
|
107
109
|
let r = Object.keys(e), i = Object.keys(t);
|
|
108
110
|
if (r.length !== i.length) return !1;
|
|
109
|
-
for (let n of r) if (!Object.prototype.hasOwnProperty.call(t, n) || !
|
|
111
|
+
for (let n of r) if (!Object.prototype.hasOwnProperty.call(t, n) || !u(e[n], t[n])) return !1;
|
|
110
112
|
return !0;
|
|
111
113
|
}
|
|
112
|
-
function
|
|
114
|
+
function d(e) {
|
|
113
115
|
return Array.isArray(e) ? [...new Set(e)] : [];
|
|
114
116
|
}
|
|
115
|
-
function
|
|
117
|
+
function f(e, t) {
|
|
116
118
|
if (!Array.isArray(e)) return [];
|
|
117
119
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
118
120
|
for (let i of e) {
|
|
@@ -121,33 +123,33 @@ function d(e, t) {
|
|
|
121
123
|
}
|
|
122
124
|
return n;
|
|
123
125
|
}
|
|
124
|
-
function
|
|
126
|
+
function p(e) {
|
|
125
127
|
if (!e) return "";
|
|
126
128
|
let t = String(e);
|
|
127
129
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
128
130
|
}
|
|
129
|
-
function
|
|
131
|
+
function m(e) {
|
|
130
132
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
131
133
|
}
|
|
132
|
-
function
|
|
134
|
+
function h(e, ...t) {
|
|
133
135
|
if (!t.length) return e;
|
|
134
136
|
let n = t.shift();
|
|
135
|
-
if (
|
|
137
|
+
if (m(e) && m(n)) {
|
|
136
138
|
for (let t in n) if (Object.prototype.hasOwnProperty.call(n, t)) {
|
|
137
139
|
let r = n[t], i = e[t];
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
m(r) ? ((!i || !m(i)) && (e[t] = {}), h(e[t], r)) : Array.isArray(r) ? (Array.isArray(i) || (e[t] = []), r.forEach((n, r) => {
|
|
141
|
+
m(n) ? (e[t][r] || (e[t][r] = {}), h(e[t][r], n)) : e[t][r] = n;
|
|
140
142
|
})) : r !== void 0 && (e[t] = r);
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
|
-
return
|
|
145
|
+
return h(e, ...t);
|
|
144
146
|
}
|
|
145
|
-
function
|
|
147
|
+
function g(e, ...t) {
|
|
146
148
|
if (!Array.isArray(e)) return [];
|
|
147
149
|
let n = new Set(t.flat());
|
|
148
150
|
return e.filter((e) => !n.has(e));
|
|
149
151
|
}
|
|
150
|
-
function
|
|
152
|
+
function _(...e) {
|
|
151
153
|
if (e.length === 0) return [];
|
|
152
154
|
let t = [...new Set(e[0])], n = e.slice(1);
|
|
153
155
|
if (n.length === 0) return t;
|
|
@@ -155,4 +157,4 @@ function g(...e) {
|
|
|
155
157
|
return t.filter((e) => r.every((t) => t.has(e)));
|
|
156
158
|
}
|
|
157
159
|
//#endregion
|
|
158
|
-
export {
|
|
160
|
+
export { n as clone, r as cloneDeep, g as difference, s as get, _ as intersection, u as isEqual, l as isNil, h as merge, o as omit, i as pick, a as pickBy, c as set, d as uniq, f as uniqBy, p as upperFirst };
|
package/dist/utils/math.js
CHANGED
|
@@ -1,2 +1,87 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as e } from "../chunks/bignumber-CC1ajqLP.js";
|
|
2
|
+
//#region src/utils/math.ts
|
|
3
|
+
var t = e.ROUND_DOWN, n = e.ROUND_UP, r = e;
|
|
4
|
+
function i(t) {
|
|
5
|
+
if (a(t)) return e(~~t);
|
|
6
|
+
if (!t) return e(0);
|
|
7
|
+
if (o(t)) return t.isNaN() ? e(0) : t;
|
|
8
|
+
let n = e(t);
|
|
9
|
+
return n.isNaN() ? e(0) : n;
|
|
10
|
+
}
|
|
11
|
+
function a(e) {
|
|
12
|
+
return typeof e == "boolean";
|
|
13
|
+
}
|
|
14
|
+
function o(t) {
|
|
15
|
+
return e.isBigNumber(t);
|
|
16
|
+
}
|
|
17
|
+
function s(e) {
|
|
18
|
+
return typeof e == "number" && !c(e);
|
|
19
|
+
}
|
|
20
|
+
function c(t) {
|
|
21
|
+
return t == null || t == null ? !1 : e(t).isNaN();
|
|
22
|
+
}
|
|
23
|
+
function l(t) {
|
|
24
|
+
return t == null || t == null ? !1 : e(t).isInteger();
|
|
25
|
+
}
|
|
26
|
+
function u(e, t) {
|
|
27
|
+
return i(e).isGreaterThan(i(t));
|
|
28
|
+
}
|
|
29
|
+
function d(e, t) {
|
|
30
|
+
return i(e).isLessThan(i(t));
|
|
31
|
+
}
|
|
32
|
+
function f(e, t) {
|
|
33
|
+
return i(e).isEqualTo(i(t));
|
|
34
|
+
}
|
|
35
|
+
function p(e, t) {
|
|
36
|
+
return i(e).isGreaterThanOrEqualTo(i(t));
|
|
37
|
+
}
|
|
38
|
+
function m(e, t) {
|
|
39
|
+
return i(e).isLessThanOrEqualTo(i(t));
|
|
40
|
+
}
|
|
41
|
+
function h(e) {
|
|
42
|
+
return i(e);
|
|
43
|
+
}
|
|
44
|
+
function g(e) {
|
|
45
|
+
return i(e).toNumber();
|
|
46
|
+
}
|
|
47
|
+
function _(e, r = !1) {
|
|
48
|
+
return g(i(e).integerValue(r ? n : t));
|
|
49
|
+
}
|
|
50
|
+
function v(e) {
|
|
51
|
+
return i(e).toString();
|
|
52
|
+
}
|
|
53
|
+
function y(e, r, a = !1) {
|
|
54
|
+
let o = i(e);
|
|
55
|
+
return g(r === void 0 ? o : o.decimalPlaces(r, a ? n : t));
|
|
56
|
+
}
|
|
57
|
+
function b(e) {
|
|
58
|
+
return i(e).toFormat();
|
|
59
|
+
}
|
|
60
|
+
function x(...e) {
|
|
61
|
+
return e.length === 0 ? 0 : g(e.reduce((e, t) => i(e).plus(i(t)), 0));
|
|
62
|
+
}
|
|
63
|
+
function S(...e) {
|
|
64
|
+
return e.length === 0 ? 0 : g(e.reduce((e, t) => i(e).minus(i(t))));
|
|
65
|
+
}
|
|
66
|
+
function C(...e) {
|
|
67
|
+
return e.length === 0 ? 0 : g(e.reduce((e, t) => i(e).times(i(t)), 1));
|
|
68
|
+
}
|
|
69
|
+
function w(...e) {
|
|
70
|
+
if (e.length === 0) return 0;
|
|
71
|
+
let t = e.map((e) => h(e));
|
|
72
|
+
return t.some((e) => e.isZero()) ? 0 : t.reduce((e, t) => e.dividedBy(t)).toNumber();
|
|
73
|
+
}
|
|
74
|
+
function T(e, t) {
|
|
75
|
+
return g(i(e).pow(i(t)));
|
|
76
|
+
}
|
|
77
|
+
function E(e, t = "%") {
|
|
78
|
+
let n = i(e).times(100);
|
|
79
|
+
return `${u(n, 0) ? y(n, 2) : 0}${t}`;
|
|
80
|
+
}
|
|
81
|
+
function D(e) {
|
|
82
|
+
let t = i(e).div(100);
|
|
83
|
+
return u(t, 0) ? y(t, 4) : 0;
|
|
84
|
+
}
|
|
85
|
+
var O = u, k = p, A = d, j = m, M = f, N = c;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { r as BigNumber, t as DOWN, n as UP, x as add, w as divide, M as eq, E as formatRate, O as gt, k as gte, i as helper, o as isBigNum, a as isBool, f as isEqualTo, u as isGreaterThan, p as isGreaterThanOrEqualTo, l as isInt, d as isLessThan, m as isLessThanOrEqualTo, N as isNan, c as isNanValue, s as isNum, A as lt, j as lte, C as multiply, T as power, S as subtract, h as toBigNum, y as toDecimalPlaces, _ as toInt, b as toLocaleString, g as toNum, v as toString, D as unFormatRate };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jk-vue-comps",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "jk-vue-comps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"oxfmt": "^0.48.0",
|
|
42
42
|
"oxlint": "^1.63.0",
|
|
43
43
|
"typescript": "6.0.3",
|
|
44
|
-
"vite": "8.0.
|
|
44
|
+
"vite": "8.0.11",
|
|
45
45
|
"vite-plugin-dts": "^5.0.0",
|
|
46
46
|
"rimraf": "^6.1.3",
|
|
47
47
|
"vue-tsc": "^3.2.8"
|