jk-vue-comps 0.2.1 → 0.2.2

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.
@@ -1,10 +1,10 @@
1
1
  import { createVNode as N } from "vue";
2
- import { isString as l, isHtmlStr as p, isObject as f, isNumber as m, is as S, isArray as $, isBoolean as b, isClient as O, isDate as v, 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 D, isNullAndUnDef as q, 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 g, isNanValue as d, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, formatRate as K, helper as Q, isBigNum as X, isBool as Y, isEqualTo as ee, isGreaterThan as ie, isGreaterThanOrEqualTo as te, isInt as ne, isLessThan as re, isLessThanOrEqualTo as oe, isNum as se, multiply as ue, power as ae, subtract as le, toBigNum as ce, toDecimalPlaces as fe, toInt as pe, toLocaleString as me, toString as ge, unFormatRate as de } from "../utils/math.js";
2
+ import { isString as l, isHtmlStr as p, isObject as c, isNumber as m, 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 D, isNullAndUnDef as q, 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 g, isNanValue as d, BigNumber as A, DOWN as C, UP as G, add as Z, divide as J, formatRate as K, helper as Q, isBigNum as X, isBool as Y, isEqualTo as ee, isGreaterThan as ie, isGreaterThanOrEqualTo as te, isInt as ne, isLessThan as re, isLessThanOrEqualTo as oe, isNum as se, multiply as ue, power as ae, subtract as le, toBigNum as fe, toDecimalPlaces as ce, toInt as pe, toLocaleString as me, toString as ge, unFormatRate as de } from "../utils/math.js";
4
4
  import { propTypes as he } from "../utils/vuePropTypes.js";
5
5
  import { timeZoneOptions as we } from "../utils/timeZone.js";
6
6
  import { withInstall as Ne } from "../utils/withInstall.js";
7
- function c(e) {
7
+ function f(e) {
8
8
  try {
9
9
  return new Function(`'use strict'; return (${e});`)();
10
10
  } catch {
@@ -14,22 +14,21 @@ function c(e) {
14
14
  function h(e, t = "float", n = 6) {
15
15
  let i = String(e);
16
16
  if (i = i.replace(/(^\s*)|(\s*$)/g, ""), i !== "") {
17
- const s = i.indexOf("0") === 0 && i.length > 1 && i.indexOf(".") !== 1, r = t === "int" ? /[^\d]/g : /[^\d.]/g;
18
- if (i = i.replace(r, ""), s)
17
+ const o = i.indexOf("0") === 0 && i.length > 1 && i.indexOf(".") !== 1, r = t === "int" ? /[^\d]/g : /[^\d.]/g;
18
+ if (i = i.replace(r, ""), o)
19
19
  return "0";
20
20
  if (t === "int")
21
21
  i = i.indexOf("0") === 0 && i.length > 1 ? i.substring(0, i.length - 1) : i;
22
22
  else {
23
- const o = c(`/\\.{${n},}/g`), u = c(`/^(\\d?)+(\\.\\d{0,${n}})?$/`);
24
- i.indexOf(".") === 0 ? (i = "", i = i.replace(/[^$#$]/g, "0."), i = i.replace(o, ".")) : u.test(i) || (i = i.substring(0, i.length - 1));
23
+ const s = f(`/\\.{${n},}/g`), u = f(`/^(\\d?)+(\\.\\d{0,${n}})?$/`);
24
+ i.indexOf(".") === 0 ? (i = "", i = i.replace(/[^$#$]/g, "0."), i = i.replace(s, ".")) : u.test(i) || (i = i.substring(0, i.length - 1));
25
25
  }
26
26
  }
27
27
  return i;
28
28
  }
29
- function Se(e, t, n, i = "int", s = 6) {
29
+ function Se(e, t, n, i = "int", o = 6) {
30
30
  return (r) => {
31
- var o;
32
- e[t] = h((o = r == null ? void 0 : r.target) == null ? void 0 : o.value, i, s), n == null || n();
31
+ e[t] = h(r?.target?.value, i, o), n?.();
33
32
  };
34
33
  }
35
34
  function $e(e) {
@@ -38,7 +37,7 @@ function $e(e) {
38
37
  function be() {
39
38
  return window ? `${window.location.protocol}//${window.location.hostname}` : "";
40
39
  }
41
- function Oe() {
40
+ function ve() {
42
41
  const e = new URLSearchParams(window.location.search);
43
42
  if (!e.size)
44
43
  return;
@@ -47,34 +46,34 @@ function Oe() {
47
46
  t[n] = i;
48
47
  return t;
49
48
  }
50
- function ve(e) {
49
+ function Oe(e) {
51
50
  return l(e) ? e.replace(/\s+/g, "") : "";
52
51
  }
53
52
  function w(e = {}, t = {}) {
54
53
  let n;
55
54
  for (n in t)
56
- e[n] = f(e[n]) ? w(e[n], t[n]) : e[n] = t[n];
55
+ e[n] = c(e[n]) ? w(e[n], t[n]) : e[n] = t[n];
57
56
  return e;
58
57
  }
59
- function Ue(e, t = 6, { showPrefix: n = !0, showSuffix: i = !0, middleStr: s = "****" } = {}) {
58
+ function Ue(e, t = 6, { showPrefix: n = !0, showSuffix: i = !0, middleStr: o = "****" } = {}) {
60
59
  if (!l(e) && !m(e))
61
60
  return e;
62
- const r = String(e), o = (r == null ? void 0 : r.length) ?? 0;
63
- if (!r || !o || t <= 0)
61
+ const r = String(e), s = r?.length ?? 0;
62
+ if (!r || !s || t <= 0)
64
63
  return r;
65
- const u = n ? r.substring(0, t) : "", a = i ? r.substring(o - t) : "";
66
- return `${u}${s}${a}`;
64
+ const u = n ? r.substring(0, t) : "", a = i ? r.substring(s - t) : "";
65
+ return `${u}${o}${a}`;
67
66
  }
68
67
  function Te(e, t = "px") {
69
68
  if (!(e === null || e === "" || e === void 0))
70
69
  return d(e) ? String(e) : `${g(e)}${t}`;
71
70
  }
72
71
  function ye(e) {
73
- return e ? f(e) ? e : e.split(";").reduce((t, n) => {
74
- const [i, s] = n.trim().split(":");
72
+ return e ? c(e) ? e : e.split(";").reduce((t, n) => {
73
+ const [i, o] = n.trim().split(":");
75
74
  if (i) {
76
- const o = i.trim().replace(/-(\w)/g, (u, a) => a ? a.toUpperCase() : "");
77
- t[o] = s.trim();
75
+ const s = i.trim().replace(/-(\w)/g, (u, a) => a ? a.toUpperCase() : "");
76
+ t[s] = o.trim();
78
77
  }
79
78
  return t;
80
79
  }, {}) : {};
@@ -88,11 +87,11 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
88
87
  deepMerge: w,
89
88
  desensitization: Ue,
90
89
  divide: J,
91
- evalPro: c,
90
+ evalPro: f,
92
91
  filterInputNum: h,
93
92
  formatRate: K,
94
93
  generateFilterInputNumFn: Se,
95
- getRouterParams: Oe,
94
+ getRouterParams: ve,
96
95
  getWebsiteUrl: be,
97
96
  helper: Q,
98
97
  is: S,
@@ -100,8 +99,8 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
100
99
  isBigNum: X,
101
100
  isBool: Y,
102
101
  isBoolean: b,
103
- isClient: O,
104
- isDate: v,
102
+ isClient: v,
103
+ isDate: O,
105
104
  isDef: U,
106
105
  isEdgeBrowser: T,
107
106
  isElement: y,
@@ -124,7 +123,7 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
124
123
  isNullOrUnDef: F,
125
124
  isNum: se,
126
125
  isNumber: m,
127
- isObject: f,
126
+ isObject: c,
128
127
  isPromise: M,
129
128
  isPromiseLink: R,
130
129
  isRegExp: _,
@@ -138,12 +137,12 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
138
137
  multiply: ue,
139
138
  power: ae,
140
139
  propTypes: he,
141
- removeWhitespace: ve,
140
+ removeWhitespace: Oe,
142
141
  renderHtmlStr: $e,
143
142
  subtract: le,
144
143
  timeZoneOptions: we,
145
- toBigNum: ce,
146
- toDecimalPlaces: fe,
144
+ toBigNum: fe,
145
+ toDecimalPlaces: ce,
147
146
  toInt: pe,
148
147
  toLocaleString: me,
149
148
  toNum: g,
@@ -156,10 +155,10 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
156
155
  export {
157
156
  De as U,
158
157
  be as a,
159
- Oe as b,
160
- ve as c,
158
+ ve as b,
159
+ Oe as c,
161
160
  w as d,
162
- c as e,
161
+ f as e,
163
162
  h as f,
164
163
  Se as g,
165
164
  Ue as h,
@@ -1,99 +1,91 @@
1
- import { defineComponent as _, computed as w, onMounted as y, createVNode as I } from "vue";
2
- import { isInMobileBrowser as f } from "../utils/is.js";
1
+ import { defineComponent as m, computed as g, onMounted as C, createVNode as h } from "vue";
2
+ import { isInMobileBrowser as u } from "../utils/is.js";
3
3
  import "../utils/math.js";
4
- import { propTypes as l } from "../utils/vuePropTypes.js";
5
- import { withInstall as k } from "../utils/withInstall.js";
6
- function g(t, i) {
7
- if (!t || !i) return;
8
- const d = encodeURIComponent(i), a = encodeURIComponent("email profile"), r = encodeURIComponent(t), m = `https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=${d}&scope=${a}&client_id=${r}`;
9
- window.location.href = m;
4
+ import { propTypes as r } from "../utils/vuePropTypes.js";
5
+ import { withInstall as b } from "../utils/withInstall.js";
6
+ function d(o, c) {
7
+ if (!o || !c) return;
8
+ const l = encodeURIComponent(c), s = encodeURIComponent("email profile"), n = encodeURIComponent(o), a = `https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=${l}&scope=${s}&client_id=${n}`;
9
+ window.location.href = a;
10
10
  }
11
- const R = {
12
- clientId: l.string,
13
- redirectUri: l.string,
14
- defaultLoad: l.bool,
15
- getPopupContainer: l.funcType(),
16
- onCallback: l.funcType(),
17
- onRejectCallback: l.funcType()
18
- }, G = /* @__PURE__ */ _({
11
+ const _ = {
12
+ clientId: r.string,
13
+ redirectUri: r.string,
14
+ defaultLoad: r.bool,
15
+ getPopupContainer: r.funcType(),
16
+ onCallback: r.funcType(),
17
+ onRejectCallback: r.funcType()
18
+ }, w = /* @__PURE__ */ m({
19
19
  name: "GoogleAuth",
20
- toGoogleAuth: g,
21
- props: R,
20
+ toGoogleAuth: d,
21
+ props: _,
22
22
  slots: Object,
23
- setup(t, {
24
- slots: i,
25
- expose: d
23
+ setup(o, {
24
+ slots: c,
25
+ expose: l
26
26
  }) {
27
- const a = w(() => ({
28
- id: t.clientId,
29
- uri: t.redirectUri
27
+ const s = g(() => ({
28
+ id: o.clientId,
29
+ uri: o.redirectUri
30
30
  }));
31
- function r() {
32
- var o, e, n;
33
- return (n = (e = (o = window == null ? void 0 : window.google) == null ? void 0 : o.accounts) == null ? void 0 : e.oauth2) == null ? void 0 : n.initCodeClient;
31
+ function n() {
32
+ return window?.google?.accounts?.oauth2?.initCodeClient;
34
33
  }
35
- function m() {
36
- var e;
37
- return ((e = t.getPopupContainer) == null ? void 0 : e.call(t)) || document.body;
34
+ function a() {
35
+ return o.getPopupContainer?.() || document.body;
38
36
  }
39
- function s() {
40
- return new Promise((o) => {
41
- var n, c;
37
+ function p() {
38
+ return new Promise((t) => {
42
39
  if (!document) {
43
- o(!1);
40
+ t(!1);
44
41
  return;
45
42
  }
46
- if (f() || r()) {
47
- o(!0);
43
+ if (u() || n()) {
44
+ t(!0);
48
45
  return;
49
46
  }
50
47
  const e = document.createElement("script");
51
- e.async = !0, e.defer = !0, e.src = "https://accounts.google.com/gsi/client", (c = (n = m()) == null ? void 0 : n.appendChild) == null || c.call(n, e), e.onload = () => {
52
- o(!!r());
48
+ e.async = !0, e.defer = !0, e.src = "https://accounts.google.com/gsi/client", a()?.appendChild?.(e), e.onload = () => {
49
+ t(!!n());
53
50
  }, e.onerror = () => {
54
- e.remove(), o(!1);
51
+ e.remove(), t(!1);
55
52
  };
56
53
  });
57
54
  }
58
- async function C() {
59
- var n, c, h;
55
+ async function f() {
60
56
  const {
61
- id: o,
57
+ id: t,
62
58
  uri: e
63
- } = a.value;
64
- if (!f() && !await s()) {
65
- g(o || "", e || "");
59
+ } = s.value;
60
+ if (!u() && !await p()) {
61
+ d(t || "", e || "");
66
62
  return;
67
63
  }
68
- if (f() || !r()) {
69
- g(o || "", e || "");
64
+ if (u() || !n()) {
65
+ d(t || "", e || "");
70
66
  return;
71
67
  }
72
- (h = (c = (n = r()) == null ? void 0 : n({
73
- client_id: o,
68
+ n()?.({
69
+ client_id: t,
74
70
  scope: "email profile",
75
71
  redirect_uri: e,
76
- ux_mode: f() ? "redirect" : "popup",
77
- callback(u) {
78
- var p, b;
79
- u != null && u.error ? (p = t.onRejectCallback) == null || p.call(t, u.error) : (b = t.onCallback) == null || b.call(t, u);
72
+ ux_mode: u() ? "redirect" : "popup",
73
+ callback(i) {
74
+ i?.error ? o.onRejectCallback?.(i.error) : o.onCallback?.(i);
80
75
  }
81
- })) == null ? void 0 : c.requestCode) == null || h.call(c);
76
+ })?.requestCode?.();
82
77
  }
83
- return y(() => {
84
- t.defaultLoad && s();
85
- }), d({
86
- startCheck: C
87
- }), () => {
88
- var o;
89
- return I("div", null, [(o = i.default) == null ? void 0 : o.call(i, {
90
- startCheck: C
91
- })]);
92
- };
78
+ return C(() => {
79
+ o.defaultLoad && p();
80
+ }), l({
81
+ startCheck: f
82
+ }), () => h("div", null, [c.default?.({
83
+ startCheck: f
84
+ })]);
93
85
  }
94
- }), $ = k(G);
86
+ }), T = b(w);
95
87
  export {
96
- $ as GoogleAuth,
97
- $ as default,
98
- g as toGoogleAuth
88
+ T as GoogleAuth,
89
+ T as default,
90
+ d as toGoogleAuth
99
91
  };
@@ -1,112 +1,104 @@
1
- import { defineComponent as w, computed as C, onMounted as _, createVNode as T } from "vue";
2
- import { a as p } from "../chunks/index-DiBTCIdi.js";
1
+ import { defineComponent as p, computed as g, onMounted as h, createVNode as b } from "vue";
2
+ import { a as w } from "../chunks/index-CAW2nf5W.js";
3
3
  import { propTypes as l } from "../utils/vuePropTypes.js";
4
- import { withInstall as y } from "../utils/withInstall.js";
5
- import { isInMobileBrowser as m } from "../utils/is.js";
6
- function f(t, o) {
7
- if (!t || !o) return;
8
- const c = encodeURIComponent(p()), a = encodeURIComponent(o), r = `https://oauth.telegram.org/auth?bot_id=${t}&origin=${c}&embed=1&request_access=write&return_to=${c}${a}`;
9
- window.location.href = r;
4
+ import { withInstall as C } from "../utils/withInstall.js";
5
+ import { isInMobileBrowser as i } from "../utils/is.js";
6
+ function s(t, a) {
7
+ if (!t || !a) return;
8
+ const c = encodeURIComponent(w()), r = encodeURIComponent(a), n = `https://oauth.telegram.org/auth?bot_id=${t}&origin=${c}&embed=1&request_access=write&return_to=${c}${r}`;
9
+ window.location.href = n;
10
10
  }
11
- function A() {
11
+ function _() {
12
12
  const t = /[#\?\&]tgAuthResult=([A-Za-z0-9\-_=]*)$/;
13
13
  try {
14
- const o = window.location.hash.toString(), c = o.match(t);
14
+ const a = window.location.hash.toString(), c = a.match(t);
15
15
  if (!c)
16
16
  return null;
17
- window.location.hash = o.replace(t, "");
18
- let a = c[1].replace(/-/g, "+").replace(/_/g, "/");
19
- const r = a.length % 4;
20
- return r > 1 && (a += new Array(5 - r).join("=")), a ? JSON.parse(window.atob(a)) : null;
17
+ window.location.hash = a.replace(t, "");
18
+ let r = c[1].replace(/-/g, "+").replace(/_/g, "/");
19
+ const n = r.length % 4;
20
+ return n > 1 && (r += new Array(5 - n).join("=")), r ? JSON.parse(window.atob(r)) : null;
21
21
  } catch {
22
22
  return null;
23
23
  }
24
24
  }
25
- const j = {
25
+ const T = {
26
26
  botId: l.number,
27
27
  toPath: l.string,
28
28
  defaultLoad: l.bool,
29
29
  getPopupContainer: l.funcType(),
30
30
  onCallback: l.funcType(),
31
31
  onRejectCallback: l.funcType()
32
- }, R = /* @__PURE__ */ w({
32
+ }, y = /* @__PURE__ */ p({
33
33
  name: "TelegramAuth",
34
- toTelegramAuth: f,
35
- getTelegramAuthUrlParams: A,
36
- props: j,
34
+ toTelegramAuth: s,
35
+ getTelegramAuthUrlParams: _,
36
+ props: T,
37
37
  slots: Object,
38
38
  setup(t, {
39
- slots: o,
39
+ slots: a,
40
40
  expose: c
41
41
  }) {
42
- const a = C(() => ({
42
+ const r = g(() => ({
43
43
  id: t.botId,
44
44
  path: t.toPath
45
45
  }));
46
- function r() {
47
- var n, e;
48
- return (e = (n = window == null ? void 0 : window.Telegram) == null ? void 0 : n.Login) == null ? void 0 : e.auth;
49
- }
50
- function b() {
51
- var e;
52
- return ((e = t.getPopupContainer) == null ? void 0 : e.call(t)) || document.body;
46
+ function n() {
47
+ return window?.Telegram?.Login?.auth;
53
48
  }
54
49
  function d() {
55
- return new Promise((n) => {
56
- var u, i;
50
+ return t.getPopupContainer?.() || document.body;
51
+ }
52
+ function m() {
53
+ return new Promise((o) => {
57
54
  if (!document) {
58
- n(!1);
55
+ o(!1);
59
56
  return;
60
57
  }
61
- if (m() || r()) {
62
- n(!0);
58
+ if (i() || n()) {
59
+ o(!0);
63
60
  return;
64
61
  }
65
62
  const e = document.createElement("script");
66
- e.async = !0, e.defer = !0, e.src = "https://telegram.org/js/telegram-widget.js", (i = (u = b()) == null ? void 0 : u.appendChild) == null || i.call(u, e), e.onload = () => {
67
- n(!!r());
63
+ e.async = !0, e.defer = !0, e.src = "https://telegram.org/js/telegram-widget.js", d()?.appendChild?.(e), e.onload = () => {
64
+ o(!!n());
68
65
  }, e.onerror = () => {
69
- e.remove(), n(!1);
66
+ e.remove(), o(!1);
70
67
  };
71
68
  });
72
69
  }
73
- async function g() {
74
- var u;
70
+ async function f() {
75
71
  const {
76
- id: n,
72
+ id: o,
77
73
  path: e
78
- } = a.value;
79
- if (!m() && !await d()) {
80
- f(n || 0, e || "");
74
+ } = r.value;
75
+ if (!i() && !await m()) {
76
+ s(o || 0, e || "");
81
77
  return;
82
78
  }
83
- if (m() || !r()) {
84
- f(n || 0, e || "");
79
+ if (i() || !n()) {
80
+ s(o || 0, e || "");
85
81
  return;
86
82
  }
87
- (u = r()) == null || u({
88
- bot_id: n,
83
+ n()?.({
84
+ bot_id: o,
89
85
  request_access: !0
90
- }, (i) => {
91
- var h, s;
92
- i ? (h = t.onCallback) == null || h.call(t, i) : (s = t.onRejectCallback) == null || s.call(t);
86
+ }, (u) => {
87
+ u ? t.onCallback?.(u) : t.onRejectCallback?.();
93
88
  });
94
89
  }
95
- return _(() => {
96
- t.defaultLoad && d();
90
+ return h(() => {
91
+ t.defaultLoad && m();
97
92
  }), c({
98
- startCheck: g
99
- }), () => {
100
- var n;
101
- return T("div", null, [(n = o.default) == null ? void 0 : n.call(o, {
102
- startCheck: g
103
- })]);
104
- };
93
+ startCheck: f
94
+ }), () => b("div", null, [a.default?.({
95
+ startCheck: f
96
+ })]);
105
97
  }
106
- }), S = y(R);
98
+ }), I = C(y);
107
99
  export {
108
- S as TelegramAuth,
109
- S as default,
110
- A as getTelegramAuthUrlParams,
111
- f as toTelegramAuth
100
+ I as TelegramAuth,
101
+ I as default,
102
+ _ as getTelegramAuthUrlParams,
103
+ s as toTelegramAuth
112
104
  };
@@ -1,11 +1,11 @@
1
1
  import { isFunction as e } from "../utils/is.js";
2
- import { toValue as i } from "vue";
3
- function c(r, o) {
2
+ import { toValue as n } from "vue";
3
+ function f(o, r) {
4
4
  return function(...t) {
5
- if (!(e(o) ? o() : i(o)))
6
- return r == null ? void 0 : r(...t);
5
+ if (!(e(r) ? r() : n(r)))
6
+ return o?.(...t);
7
7
  };
8
8
  }
9
9
  export {
10
- c as useFormKeypressEnter
10
+ f as useFormKeypressEnter
11
11
  };
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 r } from "./chunks/index-DiBTCIdi.js";
4
- import { d as n, h as p, e as u, f, g, b as d, a as h, c as x, r as N, i as T, t as b } from "./chunks/index-DiBTCIdi.js";
3
+ import { U as r } from "./chunks/index-CAW2nf5W.js";
4
+ import { d as n, h as p, e as u, f, g, b as d, a as h, c as x, r as N, i as T, t as b } from "./chunks/index-CAW2nf5W.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 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-DiBTCIdi.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-CAW2nf5W.js";
8
8
  export {
9
9
  R as BigNumber,
10
10
  W as DOWN,
package/dist/utils/is.js CHANGED
@@ -1,132 +1,130 @@
1
- function t(n, e) {
2
- return Object.prototype.toString.call(n) === `[object ${e}]`;
1
+ function e(n, t) {
2
+ return Object.prototype.toString.call(n) === `[object ${t}]`;
3
3
  }
4
- function p(n) {
4
+ function d(n) {
5
5
  return typeof n < "u";
6
6
  }
7
- function c(n) {
8
- return !p(n);
7
+ function s(n) {
8
+ return !d(n);
9
9
  }
10
- function u(n) {
11
- return n !== null && t(n, "Object");
10
+ function o(n) {
11
+ return n !== null && e(n, "Object");
12
12
  }
13
- function m(n) {
14
- return t(n, "Date");
13
+ function w(n) {
14
+ return e(n, "Date");
15
15
  }
16
- function d(n) {
16
+ function f(n) {
17
17
  return n === null;
18
18
  }
19
19
  function l(n) {
20
- return c(n) && d(n);
20
+ return s(n) && f(n);
21
21
  }
22
- function y(n) {
23
- return c(n) || d(n);
22
+ function m(n) {
23
+ return s(n) || f(n);
24
24
  }
25
- function A(n) {
26
- return t(n, "Number");
25
+ function b(n) {
26
+ return e(n, "Number");
27
27
  }
28
- function a(n) {
29
- return t(n, "String");
28
+ function c(n) {
29
+ return e(n, "String");
30
30
  }
31
- function f(n) {
31
+ function u(n) {
32
32
  return typeof n == "function";
33
33
  }
34
- function h(n) {
35
- return t(n, "Boolean");
34
+ function y(n) {
35
+ return e(n, "Boolean");
36
36
  }
37
- function E(n) {
38
- return t(n, "RegExp");
37
+ function A(n) {
38
+ return e(n, "RegExp");
39
39
  }
40
- function w(n) {
40
+ function g(n) {
41
41
  return n && Array.isArray(n);
42
42
  }
43
+ function h(n) {
44
+ return g(n) || c(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : o(n) ? Object.keys(n).length === 0 : !1;
45
+ }
46
+ function E(n) {
47
+ return e(n, "Promise") && o(n) && u(n.then) && u(n.catch);
48
+ }
43
49
  function N(n) {
44
- return w(n) || a(n) ? n.length === 0 : n instanceof Map || n instanceof Set ? n.size === 0 : u(n) ? Object.keys(n).length === 0 : !1;
50
+ return n instanceof Promise || typeof n?.then == "function";
45
51
  }
46
52
  function P(n) {
47
- return t(n, "Promise") && u(n) && f(n.then) && f(n.catch);
53
+ return typeof window < "u" && e(n, "Window");
48
54
  }
49
55
  function S(n) {
50
- return n instanceof Promise || typeof (n == null ? void 0 : n.then) == "function";
56
+ return o(n) && !!n.tagName;
51
57
  }
52
58
  function Z(n) {
53
- return typeof window < "u" && t(n, "Window");
54
- }
55
- function D(n) {
56
- return u(n) && !!n.tagName;
59
+ return e(n, "Map");
57
60
  }
58
- function M(n) {
59
- return t(n, "Map");
60
- }
61
- function b() {
61
+ function p() {
62
62
  return typeof window > "u";
63
63
  }
64
- function O() {
65
- return !b();
64
+ function D() {
65
+ return !p();
66
66
  }
67
- function $(n) {
67
+ function M(n) {
68
68
  return /^(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?(\/#\/)?(?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(n);
69
69
  }
70
- function x(n) {
70
+ function O(n) {
71
71
  return /\b(?:\d{1,3}.){3}\d{1,3}\b/.test(n);
72
72
  }
73
- function z(n) {
73
+ function $(n) {
74
74
  return /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n);
75
75
  }
76
- function B(n) {
77
- const e = /^1[3456789]\d{9}$/, r = /^(\d{3,4}-)?\d{7,8}$/;
78
- return !!(e.test(n) || r.test(n));
76
+ function x(n) {
77
+ const t = /^1[3456789]\d{9}$/, r = /^(\d{3,4}-)?\d{7,8}$/;
78
+ return !!(t.test(n) || r.test(n));
79
79
  }
80
- function U() {
80
+ function z() {
81
81
  return typeof navigator < "u" && navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i);
82
82
  }
83
- function j(n) {
84
- var i, s;
85
- const e = (s = (i = n == null ? void 0 : n.replace(/\s+/g, "")) == null ? void 0 : i.toUpperCase) == null ? void 0 : s.call(i), r = ["ZH-CN", "ZH_CH", "ZH"], g = ["EN", "EN-US"];
86
- return r.some((o) => o === e) || !g.some((o) => o === e);
83
+ function B(n) {
84
+ const t = n?.replace(/\s+/g, "")?.toUpperCase?.(), r = ["ZH-CN", "ZH_CH", "ZH"], a = ["EN", "EN-US"];
85
+ return r.some((i) => i === t) || !a.some((i) => i === t);
87
86
  }
88
- function H() {
89
- var e;
87
+ function U() {
90
88
  if (navigator.userAgent.indexOf("Edge") > -1)
91
89
  return !0;
92
- const n = ((e = navigator == null ? void 0 : navigator.userAgentData) == null ? void 0 : e.brands) ?? [];
93
- for (const r of n)
94
- if ((r == null ? void 0 : r.brand) === "Microsoft Edge")
90
+ const n = navigator?.userAgentData?.brands ?? [];
91
+ for (const t of n)
92
+ if (t?.brand === "Microsoft Edge")
95
93
  return !0;
96
94
  return !1;
97
95
  }
98
- function _(n) {
99
- return a(n) && /<[^>]+>/g.test(n);
96
+ function j(n) {
97
+ return c(n) && /<[^>]+>/g.test(n);
100
98
  }
101
99
  export {
102
- t as is,
103
- w as isArray,
104
- h as isBoolean,
105
- O as isClient,
106
- m as isDate,
107
- p as isDef,
108
- H as isEdgeBrowser,
109
- D as isElement,
110
- z as isEmail,
111
- N as isEmpty,
112
- f as isFunction,
113
- _ as isHtmlStr,
114
- U as isInMobileBrowser,
115
- x as isIp,
116
- M as isMap,
117
- d as isNull,
100
+ e as is,
101
+ g as isArray,
102
+ y as isBoolean,
103
+ D as isClient,
104
+ w as isDate,
105
+ d as isDef,
106
+ U as isEdgeBrowser,
107
+ S as isElement,
108
+ $ as isEmail,
109
+ h as isEmpty,
110
+ u as isFunction,
111
+ j as isHtmlStr,
112
+ z as isInMobileBrowser,
113
+ O as isIp,
114
+ Z as isMap,
115
+ f as isNull,
118
116
  l as isNullAndUnDef,
119
- y as isNullOrUnDef,
120
- A as isNumber,
121
- u as isObject,
122
- P as isPromise,
123
- S as isPromiseLink,
124
- E as isRegExp,
125
- b as isServer,
126
- a as isString,
127
- c as isUnDef,
128
- $ as isUrl,
129
- B as isValidPhoneNumber,
130
- Z as isWindow,
131
- j as isZhLang
117
+ m as isNullOrUnDef,
118
+ b as isNumber,
119
+ o as isObject,
120
+ E as isPromise,
121
+ N as isPromiseLink,
122
+ A as isRegExp,
123
+ p as isServer,
124
+ c as isString,
125
+ s as isUnDef,
126
+ M as isUrl,
127
+ x as isValidPhoneNumber,
128
+ P as isWindow,
129
+ B as isZhLang
132
130
  };
@@ -143,7 +143,7 @@ function Ee(a) {
143
143
  return Ne(arguments, -1);
144
144
  }, g.minimum = g.min = function() {
145
145
  return Ne(arguments, 1);
146
- }, g.random = function() {
146
+ }, g.random = (function() {
147
147
  var e = 9007199254740992, r = Math.random() * e & 2097151 ? function() {
148
148
  return $(Math.random() * e);
149
149
  } : function() {
@@ -175,10 +175,10 @@ function Ee(a) {
175
175
  }
176
176
  return o.e = u, o.c = l, o;
177
177
  };
178
- }(), g.sum = function() {
178
+ })(), g.sum = function() {
179
179
  for (var e = 1, r = arguments, n = new g(r[0]); e < r.length; ) n = n.plus(r[e++]);
180
180
  return n;
181
- }, d = /* @__PURE__ */ function() {
181
+ }, d = /* @__PURE__ */ (function() {
182
182
  var e = "0123456789";
183
183
  function r(n, s, t, u) {
184
184
  for (var c, i = [0], f, l = 0, o = n.length; l < o; ) {
@@ -209,7 +209,7 @@ function Ee(a) {
209
209
  }
210
210
  return n;
211
211
  };
212
- }(), p = /* @__PURE__ */ function() {
212
+ })(), p = /* @__PURE__ */ (function() {
213
213
  function e(s, t, u) {
214
214
  var c, i, f, l, o = 0, h = s.length, N = t % Q, m = t / Q | 0;
215
215
  for (s = s.slice(); h--; )
@@ -271,7 +271,7 @@ function Ee(a) {
271
271
  D.e = l, D.r = +h;
272
272
  return D;
273
273
  };
274
- }();
274
+ })();
275
275
  function le(e, r, n, s) {
276
276
  var t, u, c, i, f;
277
277
  if (n == null ? n = R : B(n, 0, 8), !e.c) return e.toString();
@@ -296,7 +296,7 @@ function Ee(a) {
296
296
  for (t = r[0]; t >= 10; t /= 10, s++) ;
297
297
  return (n = s + n * E - 1) > H ? e.c = e.e = null : n < K ? e.c = [e.e = 0] : (e.e = n, e.c = r), e;
298
298
  }
299
- O = /* @__PURE__ */ function() {
299
+ O = /* @__PURE__ */ (function() {
300
300
  var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, r = /^([^.]+)\.$/, n = /^\.([^.]+)$/, s = /^-?(Infinity|NaN)$/, t = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
301
301
  return function(u, c, i, f) {
302
302
  var l, o = i ? c : c.replace(t, "");
@@ -313,7 +313,7 @@ function Ee(a) {
313
313
  }
314
314
  u.c = u.e = null;
315
315
  };
316
- }();
316
+ })();
317
317
  function q(e, r, n, s) {
318
318
  var t, u, c, i, f, l, o, h = e.c, N = we;
319
319
  if (h) {
@@ -1,29 +1,31 @@
1
- var l = Object.defineProperty;
2
- var r = (n, e, i) => e in n ? l(n, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[e] = i;
3
- var a = (n, e, i) => r(n, typeof e != "symbol" ? e + "" : e, i);
4
- import * as s from "vue-types";
5
- const { createTypes: u, toValidableType: o } = s, t = void 0;
6
- class c extends u({
7
- func: t,
8
- bool: t,
9
- string: t,
10
- number: t,
11
- object: t,
12
- integer: t
1
+ import * as t from "vue-types";
2
+ const { createTypes: a, toValidableType: s } = t, e = void 0;
3
+ class o extends a({
4
+ func: e,
5
+ bool: e,
6
+ string: e,
7
+ number: e,
8
+ object: e,
9
+ integer: e
13
10
  }) {
11
+ static vueTypes = t;
12
+ static anyType = t.any;
13
+ static stringType = t.string;
14
+ static boolType = t.bool;
15
+ static numberType = t.number;
16
+ static funcType = t.func;
14
17
  static get style() {
15
- return o("style", {
18
+ return s("style", {
16
19
  type: [Object],
17
- default: t
20
+ default: e
18
21
  });
19
22
  }
20
23
  static get vueNode() {
21
- return o("vueNode", { default: t });
24
+ return s("vueNode", { default: e });
22
25
  }
23
26
  }
24
- a(c, "vueTypes", s), a(c, "anyType", s.any), a(c, "stringType", s.string), a(c, "boolType", s.bool), a(c, "numberType", s.number), a(c, "funcType", s.func);
25
- const b = c;
27
+ const n = o;
26
28
  export {
27
- c as default,
28
- b as propTypes
29
+ o as default,
30
+ n as propTypes
29
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jk-vue-comps",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
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.18",
30
+ "vue": "3.5.21",
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.1.4",
36
- "@types/node": "^24.1.0",
37
- "@vitejs/plugin-vue": "5.2.4",
38
- "@vitejs/plugin-vue-jsx": "4.2.0",
39
- "@typescript-eslint/eslint-plugin": "^8.38.0",
40
- "@typescript-eslint/parser": "^8.38.0",
41
- "eslint": "^9.32.0",
36
+ "@types/node": "^22.18.0",
37
+ "@vitejs/plugin-vue": "6.0.1",
38
+ "@vitejs/plugin-vue-jsx": "5.1.1",
39
+ "@typescript-eslint/eslint-plugin": "^8.43.0",
40
+ "@typescript-eslint/parser": "^8.43.0",
41
+ "eslint": "^9.35.0",
42
42
  "eslint-config-prettier": "^10.1.8",
43
43
  "eslint-plugin-import": "^2.32.0",
44
- "eslint-plugin-prettier": "^5.5.3",
45
- "eslint-plugin-vue": "^10.3.0",
46
- "@eslint/js": "^9.32.0",
47
- "globals": "^16.3.0",
44
+ "eslint-plugin-prettier": "^5.5.4",
45
+ "eslint-plugin-vue": "^10.4.0",
46
+ "@eslint/js": "^9.35.0",
47
+ "globals": "^16.4.0",
48
48
  "prettier": "^3.6.2",
49
49
  "tslib": "^2.8.1",
50
- "typescript": "^5.8.3",
51
- "vite": "6.3.5",
52
- "vue-tsc": "^3.0.4"
50
+ "typescript": "5.9.2",
51
+ "vite": "7.1.5",
52
+ "vue-tsc": "^3.0.7"
53
53
  }
54
54
  }