jk-vue-comps 0.2.4 → 0.2.6

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,178 @@
1
+ import { nextTick as N, createVNode as h } from "vue";
2
+ import { isString as l, isHtmlStr as f, isObject as c, isNumber as p, is as v, isArray as S, isBoolean as P, isClient as b, isDate as y, isDef as O, isEdgeBrowser as T, isElement as U, isEmail as $, isEmpty as E, isFunction as I, isInMobileBrowser as B, isIp as L, isMap as x, isNull as D, isNullAndUnDef as F, isNullOrUnDef as M, isPromise as R, isPromiseLink as V, isRegExp as W, isServer as _, isUnDef as k, isUrl as q, isValidPhoneNumber as j, isWindow as z, isZhLang as H } from "../utils/is.js";
3
+ import { toNum as m, isNanValue as g, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, eq as K, formatRate as Q, gt as X, gte as Y, helper as tt, isBigNum as et, isBool as it, isEqualTo as rt, isGreaterThan as nt, isGreaterThanOrEqualTo as ot, isInt as st, isLessThan as at, isLessThanOrEqualTo as ut, isNan as lt, isNum as ct, lt as ft, lte as pt, multiply as mt, power as gt, subtract as dt, toBigNum as wt, toDecimalPlaces as Nt, toInt as ht, toLocaleString as vt, toString as St, unFormatRate as Pt } from "../utils/math.js";
4
+ import { propTypes as bt } from "../utils/vuePropTypes.js";
5
+ import { timeZoneOptions as yt } from "../utils/timeZone.js";
6
+ import { withInstall as Ot } from "../utils/withInstall.js";
7
+ function Tt(t) {
8
+ try {
9
+ return new Function(`'use strict'; return (${t});`)();
10
+ } catch {
11
+ return null;
12
+ }
13
+ }
14
+ function d(t, e = "float", r = 6) {
15
+ const o = e === "int";
16
+ let i = String(t).trim();
17
+ if (i = i.replace(/(^\s*)|(\s*$)/g, ""), i = i.replace(o ? /[^\d]/g : /[^\d.]/g, ""), i = i.replace(/^0+(?=\d)/, ""), !i)
18
+ return "";
19
+ if (o)
20
+ return i.replace(/^(0\.|\.)/, "");
21
+ if (i.startsWith("."))
22
+ return "0.";
23
+ if (i.includes(".")) {
24
+ const n = i.split("."), a = n[0];
25
+ let s = n[1];
26
+ s.length > r && (s = s.slice(0, r)), i = `${a}.${s}`;
27
+ }
28
+ return i;
29
+ }
30
+ function Ut(t, e, r, o = "int", i = 6) {
31
+ return (n) => {
32
+ const a = n?.target?.value ?? t[e], s = d(a, o, i);
33
+ s !== a && (n?.target && Object.prototype.hasOwnProperty.call(n.target, "value") && (n.target.value = s), N(() => {
34
+ t[e] = s, n?.target?.focus?.();
35
+ })), r?.();
36
+ };
37
+ }
38
+ function $t(t) {
39
+ return !l(t) || !f(t) ? t : h("div", { innerHTML: t });
40
+ }
41
+ function Et() {
42
+ return window ? `${window.location.protocol}//${window.location.hostname}` : "";
43
+ }
44
+ function It() {
45
+ const t = new URLSearchParams(window.location.search);
46
+ if (!t.size)
47
+ return;
48
+ const e = {};
49
+ for (const [r, o] of t.entries())
50
+ e[r] = o;
51
+ return e;
52
+ }
53
+ function Bt(t) {
54
+ return l(t) ? t.replace(/\s+/g, "") : "";
55
+ }
56
+ function w(t = {}, e = {}) {
57
+ let r;
58
+ for (r in e)
59
+ t[r] = c(t[r]) ? w(t[r], e[r]) : t[r] = e[r];
60
+ return t;
61
+ }
62
+ function Lt(t, e = 6, { showPrefix: r = !0, showSuffix: o = !0, middleStr: i = "****" } = {}) {
63
+ if (!l(t) && !p(t))
64
+ return t;
65
+ const n = String(t), a = n?.length ?? 0;
66
+ if (!n || !a || e <= 0)
67
+ return n;
68
+ const s = r ? n.substring(0, e) : "", u = o ? n.substring(a - e) : "";
69
+ return `${s}${i}${u}`;
70
+ }
71
+ function xt(t, e = "px") {
72
+ if (!(t === null || t === "" || t === void 0))
73
+ return g(t) ? String(t) : `${m(t)}${e}`;
74
+ }
75
+ function Dt(t) {
76
+ return t ? c(t) ? t : t.split(";").reduce((e, r) => {
77
+ const [o, i] = r.trim().split(":");
78
+ if (o) {
79
+ const a = o.trim().replace(/-(\w)/g, (s, u) => u ? u.toUpperCase() : "");
80
+ e[a] = i.trim();
81
+ }
82
+ return e;
83
+ }, {}) : {};
84
+ }
85
+ const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
86
+ __proto__: null,
87
+ BigNumber: A,
88
+ DOWN: C,
89
+ UP: G,
90
+ add: Z,
91
+ deepMerge: w,
92
+ desensitization: Lt,
93
+ divide: J,
94
+ eq: K,
95
+ evalPro: Tt,
96
+ filterInputNum: d,
97
+ formatRate: Q,
98
+ generateFilterInputNumFn: Ut,
99
+ getRouterParams: It,
100
+ getWebsiteUrl: Et,
101
+ gt: X,
102
+ gte: Y,
103
+ helper: tt,
104
+ is: v,
105
+ isArray: S,
106
+ isBigNum: et,
107
+ isBool: it,
108
+ isBoolean: P,
109
+ isClient: b,
110
+ isDate: y,
111
+ isDef: O,
112
+ isEdgeBrowser: T,
113
+ isElement: U,
114
+ isEmail: $,
115
+ isEmpty: E,
116
+ isEqualTo: rt,
117
+ isFunction: I,
118
+ isGreaterThan: nt,
119
+ isGreaterThanOrEqualTo: ot,
120
+ isHtmlStr: f,
121
+ isInMobileBrowser: B,
122
+ isInt: st,
123
+ isIp: L,
124
+ isLessThan: at,
125
+ isLessThanOrEqualTo: ut,
126
+ isMap: x,
127
+ isNan: lt,
128
+ isNanValue: g,
129
+ isNull: D,
130
+ isNullAndUnDef: F,
131
+ isNullOrUnDef: M,
132
+ isNum: ct,
133
+ isNumber: p,
134
+ isObject: c,
135
+ isPromise: R,
136
+ isPromiseLink: V,
137
+ isRegExp: W,
138
+ isServer: _,
139
+ isString: l,
140
+ isUnDef: k,
141
+ isUrl: q,
142
+ isValidPhoneNumber: j,
143
+ isWindow: z,
144
+ isZhLang: H,
145
+ lt: ft,
146
+ lte: pt,
147
+ multiply: mt,
148
+ power: gt,
149
+ propTypes: bt,
150
+ removeWhitespace: Bt,
151
+ renderHtmlStr: $t,
152
+ subtract: dt,
153
+ timeZoneOptions: yt,
154
+ toBigNum: wt,
155
+ toDecimalPlaces: Nt,
156
+ toInt: ht,
157
+ toLocaleString: vt,
158
+ toNum: m,
159
+ toString: St,
160
+ toStyleObject: Dt,
161
+ toStyleUnit: xt,
162
+ unFormatRate: Pt,
163
+ withInstall: Ot
164
+ }, Symbol.toStringTag, { value: "Module" }));
165
+ export {
166
+ kt as U,
167
+ Et as a,
168
+ It as b,
169
+ Bt as c,
170
+ w as d,
171
+ Tt as e,
172
+ d as f,
173
+ Ut as g,
174
+ Lt as h,
175
+ Dt as i,
176
+ $t as r,
177
+ xt as t
178
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as f, computed as p, onMounted as g, createVNode as h } from "vue";
2
- import { a as w } from "../chunks/index-CHtnAuFs.js";
2
+ import { a as w } from "../chunks/index-C5FNYxxn.js";
3
3
  import { withInstall as b } from "../utils/withInstall.js";
4
4
  import { isInMobileBrowser as l } from "../utils/is.js";
5
5
  function u(t, a) {
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as e } from "./chunks/index-DyiqKziC.js";
2
2
  import { H as s } from "./chunks/index-BXoUaF-m.js";
3
- import { U as t } from "./chunks/index-CHtnAuFs.js";
4
- import { d as n, h as p, e as u, f, g, b as d, a as h, c as N, r as x, i as T, t as b } from "./chunks/index-CHtnAuFs.js";
3
+ import { U as t } from "./chunks/index-C5FNYxxn.js";
4
+ import { d as n, h as p, e as u, f, g, b as d, a as h, c as N, r as x, i as T, t as b } from "./chunks/index-C5FNYxxn.js";
5
5
  import { GoogleAuth as U, toGoogleAuth as E } from "./components/GoogleAuth.js";
6
6
  import { TelegramAuth as P, getTelegramAuthUrlParams as S, toTelegramAuth as A } from "./components/TelegramAuth.js";
7
7
  import { copyTextToClipboard as C, useCopyToClipboard as D } from "./hooks/useCopyToClipboard.js";
@@ -4,7 +4,7 @@ import { BigNumber as F, DOWN as R, UP as W, add as M, divide as j, eq as A, for
4
4
  import { propTypes as fe } from "./vuePropTypes.js";
5
5
  import { timeZoneOptions as he } from "./timeZone.js";
6
6
  import { withInstall as ce } from "./withInstall.js";
7
- import { d as Se, h as Te, e as xe, f as Be, g as De, b as Ie, a as Oe, c as Pe, r as Ue, i as ye, t as we } from "../chunks/index-CHtnAuFs.js";
7
+ import { d as Se, h as Te, e as xe, f as Be, g as De, b as Ie, a as Oe, c as Pe, r as Ue, i as ye, t as we } from "../chunks/index-C5FNYxxn.js";
8
8
  export {
9
9
  F as BigNumber,
10
10
  R as DOWN,
@@ -569,7 +569,7 @@ function Oe(a) {
569
569
  return t === null ? s ? (r = "Infinity", s < 0 && (r = "-" + r)) : r = "NaN" : (e == null ? r = t <= C || t >= k ? oe(y(n.c), t) : Z(y(n.c), t, "0") : e === 10 && se ? (n = q(new g(n), S + t + 1, R), r = Z(y(n.c), n.e, "0")) : (B(e, 2, b.length, "Base"), r = d(Z(y(n.c), t, "0"), 10, e, s, !0)), s < 0 && n.c[0] && (r = "-" + r)), r;
570
570
  }, w.valueOf = w.toJSON = function() {
571
571
  return Y(this);
572
- }, w._isBigNumber = !0, w[Symbol.toStringTag] = "BigNumber", w[Symbol.for("nodejs.util.inspect.custom")] = w.valueOf, a != null && g.set(a), g;
572
+ }, w._isBigNumber = !0, w[Symbol.toStringTag] = "BigNumber", w[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = w.valueOf, a != null && g.set(a), g;
573
573
  }
574
574
  function z(a) {
575
575
  var p = a | 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jk-vue-comps",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "jk-vue-comps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,28 +27,28 @@
27
27
  "check-types": "tsc --project tsconfig.json --noEmitOnError"
28
28
  },
29
29
  "dependencies": {
30
- "vue": "3.5.25",
30
+ "vue": "3.5.26",
31
31
  "vue-types": "^6.0.0",
32
32
  "bignumber.js": "^9.3.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@rollup/plugin-typescript": "^12.3.0",
36
36
  "@types/node": "22.18.0",
37
- "@vitejs/plugin-vue": "6.0.2",
37
+ "@vitejs/plugin-vue": "6.0.3",
38
38
  "@vitejs/plugin-vue-jsx": "5.1.2",
39
- "@typescript-eslint/eslint-plugin": "^8.47.0",
40
- "@typescript-eslint/parser": "^8.47.0",
39
+ "@typescript-eslint/eslint-plugin": "^8.50.1",
40
+ "@typescript-eslint/parser": "^8.50.1",
41
41
  "eslint": "^9.39.1",
42
42
  "eslint-config-prettier": "^10.1.8",
43
43
  "eslint-plugin-import": "^2.32.0",
44
44
  "eslint-plugin-prettier": "^5.5.4",
45
- "eslint-plugin-vue": "^10.6.0",
46
- "@eslint/js": "^9.39.1",
45
+ "eslint-plugin-vue": "^10.6.2",
46
+ "@eslint/js": "^9.39.2",
47
47
  "globals": "^16.5.0",
48
- "prettier": "^3.6.2",
48
+ "prettier": "^3.7.4",
49
49
  "tslib": "^2.8.1",
50
50
  "typescript": "5.9.3",
51
- "vite": "7.2.4",
52
- "vue-tsc": "^3.1.5"
51
+ "vite": "7.3.0",
52
+ "vue-tsc": "^3.2.1"
53
53
  }
54
54
  }
@@ -1,174 +0,0 @@
1
- import { createVNode as N } from "vue";
2
- import { isString as l, isHtmlStr as p, isObject as c, isNumber as g, is as S, isArray as $, isBoolean as b, isClient as v, isDate as O, isDef as U, isEdgeBrowser as T, isElement as y, isEmail as P, isEmpty as x, isFunction as E, isInMobileBrowser as B, isIp as I, isMap as L, isNull as q, isNullAndUnDef as D, isNullOrUnDef as F, isPromise as M, isPromiseLink as R, isRegExp as _, isServer as k, isUnDef as W, isUrl as j, isValidPhoneNumber as z, isWindow as H, isZhLang as V } from "../utils/is.js";
3
- import { toNum as m, isNanValue as d, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, eq as K, formatRate as Q, gt as X, gte as Y, helper as ee, isBigNum as te, isBool as ie, isEqualTo as ne, isGreaterThan as re, isGreaterThanOrEqualTo as oe, isInt as se, isLessThan as ue, isLessThanOrEqualTo as ae, isNan as le, isNum as fe, lt as ce, lte as pe, multiply as ge, power as me, subtract as de, toBigNum as he, toDecimalPlaces as we, toInt as Ne, toLocaleString as Se, toString as $e, unFormatRate as be } from "../utils/math.js";
4
- import { propTypes as ve } from "../utils/vuePropTypes.js";
5
- import { timeZoneOptions as Oe } from "../utils/timeZone.js";
6
- import { withInstall as Ue } from "../utils/withInstall.js";
7
- function f(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 o = t.indexOf("0") === 0 && t.length > 1 && t.indexOf(".") !== 1, r = i === "int" ? /[^\d]/g : /[^\d.]/g;
18
- if (t = t.replace(r, ""), o)
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 s = f(`/\\.{${n},}/g`), u = f(`/^(\\d?)+(\\.\\d{0,${n}})?$/`);
24
- t.indexOf(".") === 0 ? (t = "", t = t.replace(/[^$#$]/g, "0."), t = t.replace(s, ".")) : u.test(t) || (t = t.substring(0, t.length - 1));
25
- }
26
- }
27
- return t;
28
- }
29
- function Te(e, i, n, t = "int", o = 6) {
30
- return (r) => {
31
- e[i] = h(r?.target?.value, t, o), n?.();
32
- };
33
- }
34
- function ye(e) {
35
- return !l(e) || !p(e) ? e : N("div", { innerHTML: e });
36
- }
37
- function Pe() {
38
- return window ? `${window.location.protocol}//${window.location.hostname}` : "";
39
- }
40
- function xe() {
41
- const e = new URLSearchParams(window.location.search);
42
- if (!e.size)
43
- return;
44
- const i = {};
45
- for (const [n, t] of e.entries())
46
- i[n] = t;
47
- return i;
48
- }
49
- function Ee(e) {
50
- return l(e) ? e.replace(/\s+/g, "") : "";
51
- }
52
- function w(e = {}, i = {}) {
53
- let n;
54
- for (n in i)
55
- e[n] = c(e[n]) ? w(e[n], i[n]) : e[n] = i[n];
56
- return e;
57
- }
58
- function Be(e, i = 6, { showPrefix: n = !0, showSuffix: t = !0, middleStr: o = "****" } = {}) {
59
- if (!l(e) && !g(e))
60
- return e;
61
- const r = String(e), s = r?.length ?? 0;
62
- if (!r || !s || i <= 0)
63
- return r;
64
- const u = n ? r.substring(0, i) : "", a = t ? r.substring(s - i) : "";
65
- return `${u}${o}${a}`;
66
- }
67
- function Ie(e, i = "px") {
68
- if (!(e === null || e === "" || e === void 0))
69
- return d(e) ? String(e) : `${m(e)}${i}`;
70
- }
71
- function Le(e) {
72
- return e ? c(e) ? e : e.split(";").reduce((i, n) => {
73
- const [t, o] = n.trim().split(":");
74
- if (t) {
75
- const s = t.trim().replace(/-(\w)/g, (u, a) => a ? a.toUpperCase() : "");
76
- i[s] = o.trim();
77
- }
78
- return i;
79
- }, {}) : {};
80
- }
81
- const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
82
- __proto__: null,
83
- BigNumber: A,
84
- DOWN: C,
85
- UP: G,
86
- add: Z,
87
- deepMerge: w,
88
- desensitization: Be,
89
- divide: J,
90
- eq: K,
91
- evalPro: f,
92
- filterInputNum: h,
93
- formatRate: Q,
94
- generateFilterInputNumFn: Te,
95
- getRouterParams: xe,
96
- getWebsiteUrl: Pe,
97
- gt: X,
98
- gte: Y,
99
- helper: ee,
100
- is: S,
101
- isArray: $,
102
- isBigNum: te,
103
- isBool: ie,
104
- isBoolean: b,
105
- isClient: v,
106
- isDate: O,
107
- isDef: U,
108
- isEdgeBrowser: T,
109
- isElement: y,
110
- isEmail: P,
111
- isEmpty: x,
112
- isEqualTo: ne,
113
- isFunction: E,
114
- isGreaterThan: re,
115
- isGreaterThanOrEqualTo: oe,
116
- isHtmlStr: p,
117
- isInMobileBrowser: B,
118
- isInt: se,
119
- isIp: I,
120
- isLessThan: ue,
121
- isLessThanOrEqualTo: ae,
122
- isMap: L,
123
- isNan: le,
124
- isNanValue: d,
125
- isNull: q,
126
- isNullAndUnDef: D,
127
- isNullOrUnDef: F,
128
- isNum: fe,
129
- isNumber: g,
130
- isObject: c,
131
- isPromise: M,
132
- isPromiseLink: R,
133
- isRegExp: _,
134
- isServer: k,
135
- isString: l,
136
- isUnDef: W,
137
- isUrl: j,
138
- isValidPhoneNumber: z,
139
- isWindow: H,
140
- isZhLang: V,
141
- lt: ce,
142
- lte: pe,
143
- multiply: ge,
144
- power: me,
145
- propTypes: ve,
146
- removeWhitespace: Ee,
147
- renderHtmlStr: ye,
148
- subtract: de,
149
- timeZoneOptions: Oe,
150
- toBigNum: he,
151
- toDecimalPlaces: we,
152
- toInt: Ne,
153
- toLocaleString: Se,
154
- toNum: m,
155
- toString: $e,
156
- toStyleObject: Le,
157
- toStyleUnit: Ie,
158
- unFormatRate: be,
159
- withInstall: Ue
160
- }, Symbol.toStringTag, { value: "Module" }));
161
- export {
162
- ke as U,
163
- Pe as a,
164
- xe as b,
165
- Ee as c,
166
- w as d,
167
- f as e,
168
- h as f,
169
- Te as g,
170
- Be as h,
171
- Le as i,
172
- ye as r,
173
- Ie as t
174
- };