jk-vue-comps 0.1.12 → 0.1.13

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,11 @@
1
+ import { copyTextToClipboard as o, useCopyToClipboard as e } from "../hooks/useCopyToClipboard.js";
2
+ import { useMemo as r } from "../hooks/useMemo.js";
3
+ const l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4
+ __proto__: null,
5
+ copyTextToClipboard: o,
6
+ useCopyToClipboard: e,
7
+ useMemo: r
8
+ }, Symbol.toStringTag, { value: "Module" }));
9
+ export {
10
+ l as H
11
+ };
@@ -0,0 +1,171 @@
1
+ import { nextTick as N, createVNode as S } from "vue";
2
+ import { isString as l, isHtmlStr as p, isObject as f, isNumber as m, is as $, isArray as b, isBoolean as O, isClient as v, isDate as T, isDef as U, isEdgeBrowser as x, isElement as y, isEmail as P, 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 g, toNum as d, 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 te, isGreaterThan as ie, isGreaterThanOrEqualTo as ne, isInt as re, isLessThan as oe, isLessThanOrEqualTo as se, isNum as ue, multiply as ae, power as le, subtract as ce, toBigNum as fe, toDecimalPlaces as pe, toInt as me, toLocaleString as ge, toString as de, unFormatRate as he } from "../utils/math.js";
4
+ import { propTypes as we } from "../utils/vuePropTypes.js";
5
+ import { timeZoneOptions as Ne } from "../utils/timeZone.js";
6
+ import { withInstall as Se } from "../utils/withInstall.js";
7
+ function c(e) {
8
+ try {
9
+ return new Function(`'use strict'; return (${e});`)();
10
+ } catch {
11
+ return null;
12
+ }
13
+ }
14
+ function h(e, i = "float", n = 6) {
15
+ let t = String(e);
16
+ if (t = t.replace(/(^\s*)|(\s*$)/g, ""), t !== "") {
17
+ const s = t.indexOf("0") === 0 && t.length > 1 && t.indexOf(".") !== 1, r = i === "int" ? /[^\d]/g : /[^\d.]/g;
18
+ if (t = t.replace(r, ""), s)
19
+ return "0";
20
+ if (i === "int")
21
+ t = t.indexOf("0") === 0 && t.length > 1 ? t.substring(0, t.length - 1) : t;
22
+ else {
23
+ const o = c(`/\\.{${n},}/g`), u = c(`/^(\\d?)+(\\.\\d{0,${n}})?$/`);
24
+ t.indexOf(".") === 0 ? (t = "", t = t.replace(/[^$#$]/g, "0."), t = t.replace(o, ".")) : u.test(t) || (t = t.substring(0, t.length - 1));
25
+ }
26
+ }
27
+ return t;
28
+ }
29
+ function $e(e, i, n, t = "int", s = 6) {
30
+ return (r) => {
31
+ N().then(() => {
32
+ var o;
33
+ e[i] = h((o = r == null ? void 0 : r.target) == null ? void 0 : o.value, t, s), n == null || n();
34
+ });
35
+ };
36
+ }
37
+ function be(e) {
38
+ return !l(e) || !p(e) ? e : S("div", { innerHTML: e });
39
+ }
40
+ function Oe() {
41
+ return window ? `${window.location.protocol}//${window.location.hostname}` : "";
42
+ }
43
+ function ve() {
44
+ const e = new URLSearchParams(window.location.search);
45
+ if (!e.size)
46
+ return;
47
+ const i = {};
48
+ for (const [n, t] of e.entries())
49
+ i[n] = t;
50
+ return i;
51
+ }
52
+ function Te(e) {
53
+ return l(e) ? e.replace(/\s+/g, "") : "";
54
+ }
55
+ function w(e = {}, i = {}) {
56
+ let n;
57
+ for (n in i)
58
+ e[n] = f(e[n]) ? w(e[n], i[n]) : e[n] = i[n];
59
+ return e;
60
+ }
61
+ function Ue(e, i = 6, { showPrefix: n = !0, showSuffix: t = !0, middleStr: s = "****" } = {}) {
62
+ if (!l(e) && !m(e))
63
+ return e;
64
+ const r = String(e), o = (r == null ? void 0 : r.length) ?? 0;
65
+ if (!r || !o || i <= 0)
66
+ return r;
67
+ const u = n ? r.substring(0, i) : "", a = t ? r.substring(o - i) : "";
68
+ return `${u}${s}${a}`;
69
+ }
70
+ function xe(e, i = "px") {
71
+ if (!(e === null || e === "" || e === void 0))
72
+ return g(e) ? String(e) : `${d(e)}${i}`;
73
+ }
74
+ function ye(e) {
75
+ return e ? f(e) ? e : e.split(";").reduce((i, n) => {
76
+ const [t, s] = n.trim().split(":");
77
+ if (t) {
78
+ const o = t.trim().replace(/-(\w)/g, (u, a) => a ? a.toUpperCase() : "");
79
+ i[o] = s.trim();
80
+ }
81
+ return i;
82
+ }, {}) : {};
83
+ }
84
+ const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
85
+ __proto__: null,
86
+ BigNumber: C,
87
+ DOWN: G,
88
+ UP: Z,
89
+ add: J,
90
+ deepMerge: w,
91
+ desensitization: Ue,
92
+ divide: K,
93
+ evalPro: c,
94
+ filterInputNum: h,
95
+ formatRate: Q,
96
+ generateFilterInputNumFn: $e,
97
+ getRouterParams: ve,
98
+ getWebsiteUrl: Oe,
99
+ helper: X,
100
+ is: $,
101
+ isArray: b,
102
+ isBigNum: Y,
103
+ isBool: ee,
104
+ isBoolean: O,
105
+ isClient: v,
106
+ isDate: T,
107
+ isDef: U,
108
+ isEdgeBrowser: x,
109
+ isElement: y,
110
+ isEmail: P,
111
+ isEmpty: E,
112
+ isEqualTo: te,
113
+ isFunction: B,
114
+ isGreaterThan: ie,
115
+ isGreaterThanOrEqualTo: ne,
116
+ isHtmlStr: p,
117
+ isInMobileBrowser: I,
118
+ isInt: re,
119
+ isIp: L,
120
+ isLessThan: oe,
121
+ isLessThanOrEqualTo: se,
122
+ isMap: D,
123
+ isNanValue: g,
124
+ isNull: k,
125
+ isNullAndUnDef: q,
126
+ isNullOrUnDef: F,
127
+ isNum: ue,
128
+ isNumber: m,
129
+ isObject: f,
130
+ isPromise: M,
131
+ isPromiseLink: R,
132
+ isRegExp: _,
133
+ isServer: W,
134
+ isString: l,
135
+ isUnDef: j,
136
+ isUrl: z,
137
+ isValidPhoneNumber: H,
138
+ isWindow: V,
139
+ isZhLang: A,
140
+ multiply: ae,
141
+ power: le,
142
+ propTypes: we,
143
+ removeWhitespace: Te,
144
+ renderHtmlStr: be,
145
+ subtract: ce,
146
+ timeZoneOptions: Ne,
147
+ toBigNum: fe,
148
+ toDecimalPlaces: pe,
149
+ toInt: me,
150
+ toLocaleString: ge,
151
+ toNum: d,
152
+ toString: de,
153
+ toStyleObject: ye,
154
+ toStyleUnit: xe,
155
+ unFormatRate: he,
156
+ withInstall: Se
157
+ }, Symbol.toStringTag, { value: "Module" }));
158
+ export {
159
+ ke as U,
160
+ Oe as a,
161
+ ve as b,
162
+ Te as c,
163
+ w as d,
164
+ c as e,
165
+ h as f,
166
+ $e as g,
167
+ Ue as h,
168
+ ye as i,
169
+ be as r,
170
+ xe as t
171
+ };
@@ -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-BE5vnR2C.js";
3
+ import { a as _ } from "../chunks/index-ChgNR2U8.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) {
@@ -0,0 +1,2 @@
1
+ export * from './useCopyToClipboard';
2
+ export * from './useMemo';
@@ -0,0 +1,7 @@
1
+ import { copyTextToClipboard as p, useCopyToClipboard as r } from "./useCopyToClipboard.js";
2
+ import { useMemo as t } from "./useMemo.js";
3
+ export {
4
+ p as copyTextToClipboard,
5
+ r as useCopyToClipboard,
6
+ t as useMemo
7
+ };
@@ -0,0 +1,8 @@
1
+ export declare function useCopyToClipboard(initial?: string): {
2
+ clipboardRef: import("vue").Ref<string>;
3
+ isSuccessRef: import("vue").Ref<boolean>;
4
+ copiedRef: import("vue").Ref<boolean>;
5
+ };
6
+ export declare function copyTextToClipboard(input: string, { target }?: {
7
+ target?: HTMLElement;
8
+ }): boolean;
@@ -0,0 +1,26 @@
1
+ import { ref as l, watch as i } from "vue";
2
+ import { isDef as u } from "../utils/is.js";
3
+ function p(o) {
4
+ const c = l(o || ""), e = l(!1), n = l(!1);
5
+ return i(c, (t) => {
6
+ u(t) && (n.value = !0, e.value = f(t));
7
+ }, { immediate: !!o, flush: "sync" }), { clipboardRef: c, isSuccessRef: e, copiedRef: n };
8
+ }
9
+ function f(o, { target: c = document.body } = {}) {
10
+ const e = document.createElement("textarea"), n = document.activeElement;
11
+ e.value = o, e.setAttribute("readonly", ""), e.style.contain = "strict", e.style.position = "absolute", e.style.left = "-9999px", e.style.fontSize = "12pt";
12
+ const t = document.getSelection();
13
+ let s;
14
+ t && t.rangeCount > 0 && (s = t.getRangeAt(0)), c.append(e), e.select(), e.selectionStart = 0, e.selectionEnd = o.length;
15
+ let r = !1;
16
+ try {
17
+ r = document.execCommand("copy");
18
+ } catch (a) {
19
+ throw new Error(a);
20
+ }
21
+ return e.remove(), s && t && (t.removeAllRanges(), t.addRange(s)), n && n.focus(), r;
22
+ }
23
+ export {
24
+ f as copyTextToClipboard,
25
+ p as useCopyToClipboard
26
+ };
@@ -0,0 +1,2 @@
1
+ import { type Ref, type WatchSource } from 'vue';
2
+ export declare function useMemo<T>(getValue: () => T, condition: (WatchSource<unknown> | object)[], shouldUpdate?: (prev: any[], next: any[]) => boolean): Ref<T>;
@@ -0,0 +1,10 @@
1
+ import { ref as t, watch as i } from "vue";
2
+ function u(r, f, e) {
3
+ const c = t(r());
4
+ return i(f, (n, o) => {
5
+ e && !e(n, o) || (c.value = r());
6
+ }), c;
7
+ }
8
+ export {
9
+ u as useMemo
10
+ };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import * as Comps from './components';
2
+ import * as Hooks from './hooks';
2
3
  import * as Utils from './utils';
3
4
  export * from './components';
4
5
  export * from './utils';
5
6
  declare const JKVUEComps: {
6
- Utils: typeof Utils;
7
7
  Comps: typeof Comps;
8
+ Hooks: typeof Hooks;
9
+ Utils: typeof Utils;
8
10
  evalPro(str: string): any;
9
11
  filterInputNum(eventVal: string | number, type?: "int" | "float", maxDecimal?: number): string;
10
12
  generateFilterInputNumFn<T extends Recordable<any>, K extends keyof T>(obj: T, key: K, fn?: (() => void) | undefined, type?: "int" | "float", maxDecimal?: number): (e: ChangeEvent) => void;
@@ -15,7 +17,7 @@ declare const JKVUEComps: {
15
17
  getRouterParams(): Recordable<any> | undefined;
16
18
  removeWhitespace(str: any): string;
17
19
  deepMerge<T_1 = any>(src?: any, target?: any): T_1;
18
- desensitization(str?: string | number | undefined, number?: number, options?: {
20
+ desensitization(str?: string | number | undefined, number?: number, { showPrefix, showSuffix, middleStr }?: {
19
21
  showPrefix?: boolean | undefined;
20
22
  showSuffix?: boolean | undefined;
21
23
  middleStr?: string | undefined;
@@ -82,6 +84,15 @@ declare const JKVUEComps: {
82
84
  propTypes: typeof import("./utils/vuePropTypes").default;
83
85
  timeZoneOptions: Utils.TimeZoneItem[];
84
86
  withInstall<T_7>(component: T_7, alias?: string | undefined): T_7 & import("vue").Plugin;
87
+ useCopyToClipboard(initial?: string | undefined): {
88
+ clipboardRef: import("vue").Ref<string>;
89
+ isSuccessRef: import("vue").Ref<boolean>;
90
+ copiedRef: import("vue").Ref<boolean>;
91
+ };
92
+ copyTextToClipboard(input: string, { target }?: {
93
+ target?: HTMLElement | undefined;
94
+ }): boolean;
95
+ useMemo<T_8>(getValue: () => T_8, condition: (object | import("vue").WatchSource<unknown>)[], shouldUpdate?: ((prev: any[], next: any[]) => boolean) | undefined): import("vue").Ref<T_8>;
85
96
  toGoogleAuth(clientId: string, redirectUri: string): void;
86
97
  GoogleAuth: {
87
98
  new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
package/dist/index.js CHANGED
@@ -1,95 +1,98 @@
1
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 = {
2
+ import { H as s } from "./chunks/index-CB6PmcJE.js";
3
+ import { U as t } from "./chunks/index-ChgNR2U8.js";
4
+ import { d as n, h as p, e as u, f as g, g as f, b as h, a as N, c as d, r as T, i as U, t as c } from "./chunks/index-ChgNR2U8.js";
5
+ import { GoogleAuth as b, toGoogleAuth as E } from "./components/GoogleAuth.js";
6
+ import { TelegramAuth as S, getTelegramAuthUrlParams as A, toTelegramAuth as B } from "./components/TelegramAuth.js";
7
+ import { is as I, isArray as O, isBoolean as y, isClient as w, isDate as L, isDef as v, isEdgeBrowser as C, isElement as F, isEmail as G, isEmpty as H, isFunction as R, isHtmlStr as W, isInMobileBrowser as q, isIp as M, isMap as V, isNull as j, isNullAndUnDef as k, isNullOrUnDef as Z, isNumber as z, isObject as J, isPromise as K, isPromiseLink as Q, isRegExp as X, isServer as Y, isString as _, isUnDef as $, isUrl as ee, isValidPhoneNumber as se, isWindow as te, isZhLang as ie } from "./utils/is.js";
8
+ import { BigNumber as oe, DOWN as ae, UP as me, add as le, divide as ne, formatRate as pe, helper as ue, isBigNum as ge, isBool as fe, isEqualTo as he, isGreaterThan as Ne, isGreaterThanOrEqualTo as de, isInt as Te, isLessThan as Ue, isLessThanOrEqualTo as ce, isNanValue as xe, isNum as be, multiply as Ee, power as Pe, subtract as Se, toBigNum as Ae, toDecimalPlaces as Be, toInt as De, toLocaleString as Ie, toNum as Oe, toString as ye, unFormatRate as we } from "./utils/math.js";
9
+ import { propTypes as ve } from "./utils/vuePropTypes.js";
10
+ import { timeZoneOptions as Fe } from "./utils/timeZone.js";
11
+ import { withInstall as He } from "./utils/withInstall.js";
12
+ const a = {
12
13
  ...e,
13
14
  ...s,
14
- Utils: s,
15
- Comps: e
15
+ ...t,
16
+ Comps: e,
17
+ Hooks: s,
18
+ Utils: t
16
19
  };
17
20
  export {
18
- ie as BigNumber,
19
- re as DOWN,
20
- c as GoogleAuth,
21
- E as TelegramAuth,
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
- n as evalPro,
29
- u as filterInputNum,
30
- me as formatRate,
31
- p as generateFilterInputNumFn,
32
- g as getRouterParams,
33
- P as getTelegramAuthUrlParams,
34
- f as getWebsiteUrl,
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
- ce as isNum,
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
- h as removeWhitespace,
80
- N as renderHtmlStr,
81
- Ee as subtract,
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
21
+ oe as BigNumber,
22
+ ae as DOWN,
23
+ b as GoogleAuth,
24
+ S as TelegramAuth,
25
+ me as UP,
26
+ le as add,
27
+ n as deepMerge,
28
+ a as default,
29
+ p as desensitization,
30
+ ne as divide,
31
+ u as evalPro,
32
+ g as filterInputNum,
33
+ pe as formatRate,
34
+ f as generateFilterInputNumFn,
35
+ h as getRouterParams,
36
+ A as getTelegramAuthUrlParams,
37
+ N as getWebsiteUrl,
38
+ ue as helper,
39
+ I as is,
40
+ O as isArray,
41
+ ge as isBigNum,
42
+ fe as isBool,
43
+ y as isBoolean,
44
+ w as isClient,
45
+ L as isDate,
46
+ v as isDef,
47
+ C as isEdgeBrowser,
48
+ F as isElement,
49
+ G as isEmail,
50
+ H as isEmpty,
51
+ he as isEqualTo,
52
+ R as isFunction,
53
+ Ne as isGreaterThan,
54
+ de as isGreaterThanOrEqualTo,
55
+ W as isHtmlStr,
56
+ q as isInMobileBrowser,
57
+ Te as isInt,
58
+ M as isIp,
59
+ Ue as isLessThan,
60
+ ce as isLessThanOrEqualTo,
61
+ V as isMap,
62
+ xe as isNanValue,
63
+ j as isNull,
64
+ k as isNullAndUnDef,
65
+ Z as isNullOrUnDef,
66
+ be as isNum,
67
+ z as isNumber,
68
+ J as isObject,
69
+ K as isPromise,
70
+ Q as isPromiseLink,
71
+ X as isRegExp,
72
+ Y as isServer,
73
+ _ as isString,
74
+ $ as isUnDef,
75
+ ee as isUrl,
76
+ se as isValidPhoneNumber,
77
+ te as isWindow,
78
+ ie as isZhLang,
79
+ Ee as multiply,
80
+ Pe as power,
81
+ ve as propTypes,
82
+ d as removeWhitespace,
83
+ T as renderHtmlStr,
84
+ Se as subtract,
85
+ Fe as timeZoneOptions,
86
+ Ae as toBigNum,
87
+ Be as toDecimalPlaces,
88
+ E as toGoogleAuth,
89
+ De as toInt,
90
+ Ie as toLocaleString,
91
+ Oe as toNum,
92
+ ye as toString,
93
+ U as toStyleObject,
94
+ c as toStyleUnit,
95
+ B as toTelegramAuth,
96
+ we as unFormatRate,
97
+ He as withInstall
95
98
  };
@@ -40,7 +40,7 @@ export declare function deepMerge<T = any>(src?: any, target?: any): T;
40
40
  * middleStr 中间的字符串,default: '****'
41
41
  * }
42
42
  */
43
- export declare function desensitization(str?: string | number, number?: number, options?: {
43
+ export declare function desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
44
44
  showPrefix?: boolean;
45
45
  showSuffix?: boolean;
46
46
  middleStr?: string;
@@ -4,7 +4,7 @@ import { BigNumber as R, DOWN as W, UP as q, add as M, divide as j, formatRate a
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 Se, c as Te, r as xe, i as Be, t as De } from "../chunks/index-BE5vnR2C.js";
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-ChgNR2U8.js";
8
8
  export {
9
9
  R as BigNumber,
10
10
  W as DOWN,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jk-vue-comps",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "jk-vue-comps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,58 +9,6 @@
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
- "exports": {
13
- ".": {
14
- "import": "./dist/index.js",
15
- "require": "./dist/index.js",
16
- "types": "./dist/index.d.ts"
17
- },
18
- "./dist/components": {
19
- "import": "./dist/components/index.js",
20
- "require": "./dist/components/index.js",
21
- "types": "./dist/components/index.d.ts"
22
- },
23
- "./dist/components/GoogleAuth": {
24
- "import": "./dist/components/GoogleAuth.js",
25
- "require": "./dist/components/GoogleAuth.js",
26
- "types": "./dist/components/GoogleAuth.d.ts"
27
- },
28
- "./dist/components/TelegramAuth": {
29
- "import": "./dist/components/TelegramAuth.js",
30
- "require": "./dist/components/TelegramAuth.js",
31
- "types": "./dist/components/TelegramAuth.d.ts"
32
- },
33
- "./dist/utils": {
34
- "import": "./dist/utils/index.js",
35
- "require": "./dist/utils/index.js",
36
- "types": "./dist/utils/index.d.ts"
37
- },
38
- "./dist/utils/is": {
39
- "import": "./dist/utils/is.js",
40
- "require": "./dist/utils/is.js",
41
- "types": "./dist/utils/is.d.ts"
42
- },
43
- "./dist/utils/math": {
44
- "import": "./dist/utils/math.js",
45
- "require": "./dist/utils/math.js",
46
- "types": "./dist/utils/math.d.ts"
47
- },
48
- "./dist/utils/timeZone": {
49
- "import": "./dist/utils/timeZone.js",
50
- "require": "./dist/utils/timeZone.js",
51
- "types": "./dist/utils/timeZone.d.ts"
52
- },
53
- "./dist/utils/vuePropTypes": {
54
- "import": "./dist/utils/vuePropTypes.js",
55
- "require": "./dist/utils/vuePropTypes.js",
56
- "types": "./dist/utils/vuePropTypes.d.ts"
57
- },
58
- "./dist/utils/withInstall": {
59
- "import": "./dist/utils/withInstall.js",
60
- "require": "./dist/utils/withInstall.js",
61
- "types": "./dist/utils/withInstall.d.ts"
62
- }
63
- },
64
12
  "keywords": [
65
13
  "vite5",
66
14
  "vue3",
@@ -1,175 +0,0 @@
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
- };