jk-vue-comps 0.1.9 → 0.1.10

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,175 @@
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
+ };
@@ -9,5 +9,5 @@ const g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9
9
  toTelegramAuth: l
10
10
  }, Symbol.toStringTag, { value: "Module" }));
11
11
  export {
12
- g as c
12
+ g as C
13
13
  };
@@ -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-aaoImdl9.js";
3
+ import { a as _ } from "../chunks/index-BE5vnR2C.js";
4
4
  import { withInstall as A } from "../utils/withInstall.js";
5
5
  import { isEdgeBrowser as C, isInMobileBrowser as p } from "../utils/is.js";
6
6
  function d(r, o) {
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import * as comps from './components';
2
- import * as utils from './utils';
1
+ import * as Comps from './components';
2
+ import * as Utils from './utils';
3
3
  export * from './components';
4
4
  export * from './utils';
5
5
  declare const JKVUEComps: {
6
- Utils: typeof utils;
7
- Comps: typeof comps;
6
+ Utils: typeof Utils;
7
+ Comps: typeof Comps;
8
8
  evalPro(str: string): any;
9
9
  filterInputNum(eventVal: string | number, type?: "int" | "float", maxDecimal?: number): string;
10
- generateFilterInputNumFn<T extends Record<string, any>, K extends keyof T>(obj: T, key: K, fn?: (() => void) | undefined, type?: "int" | "float", maxDecimal?: number): (e: ChangeEvent) => void;
10
+ generateFilterInputNumFn<T extends Recordable<any>, K extends keyof T>(obj: T, key: K, fn?: (() => void) | undefined, type?: "int" | "float", maxDecimal?: number): (e: ChangeEvent) => void;
11
11
  renderHtmlStr(html: string): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
12
12
  [key: string]: any;
13
13
  }>;
@@ -20,6 +20,8 @@ declare const JKVUEComps: {
20
20
  showSuffix?: boolean | undefined;
21
21
  middleStr?: string | undefined;
22
22
  }): string | undefined;
23
+ toStyleUnit(str?: string | number | null | undefined, unit?: string): string | undefined;
24
+ toStyleObject(style?: string | Recordable<any> | null | undefined): Recordable<any>;
23
25
  is(val: unknown, type: string): boolean;
24
26
  isDef<T_2 = unknown>(val?: T_2 | undefined): val is T_2;
25
27
  isUnDef<T_3 = unknown>(val?: T_3 | undefined): val is T_3;
@@ -50,7 +52,7 @@ declare const JKVUEComps: {
50
52
  isIp: (ip: string) => boolean;
51
53
  isEmail: (email: string) => boolean;
52
54
  isHtmlStr: (str: string) => boolean;
53
- helper(val: utils.BigNumValType): import("bignumber.js").BigNumber;
55
+ helper(val: Utils.BigNumValType): import("bignumber.js").BigNumber;
54
56
  isBool(val: any): val is boolean;
55
57
  isBigNum(val: any): val is import("bignumber.js").BigNumber;
56
58
  isNum(val: any): val is number;
@@ -61,24 +63,24 @@ declare const JKVUEComps: {
61
63
  isEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
62
64
  isGreaterThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
63
65
  isLessThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
64
- toBigNum(val: utils.BigNumValType): import("bignumber.js").BigNumber;
65
- toNum(val: utils.BigNumValType): number;
66
- toInt(val: utils.BigNumValType, isUp?: boolean): number;
67
- toString(val: utils.BigNumValType): string;
68
- toDecimalPlaces(val: utils.BigNumValType, decimal?: number | undefined, isUp?: boolean): number;
69
- toLocaleString(val: utils.BigNumValType): string;
70
- add(...vals: utils.BigNumValType[]): number;
71
- subtract(...vals: utils.BigNumValType[]): number;
72
- multiply(...vals: utils.BigNumValType[]): number;
73
- divide(...vals: utils.BigNumValType[]): number;
74
- power(base: utils.BigNumValType, exponent: utils.BigNumValType): number;
75
- formatRate(val: utils.BigNumValType, unit?: string): string;
76
- unFormatRate(val: utils.BigNumValType): number;
66
+ toBigNum(val: Utils.BigNumValType): import("bignumber.js").BigNumber;
67
+ toNum(val: Utils.BigNumValType): number;
68
+ toInt(val: Utils.BigNumValType, isUp?: boolean): number;
69
+ toString(val: Utils.BigNumValType): string;
70
+ toDecimalPlaces(val: Utils.BigNumValType, decimal?: number | undefined, isUp?: boolean): number;
71
+ toLocaleString(val: Utils.BigNumValType): string;
72
+ add(...vals: Utils.BigNumValType[]): number;
73
+ subtract(...vals: Utils.BigNumValType[]): number;
74
+ multiply(...vals: Utils.BigNumValType[]): number;
75
+ divide(...vals: Utils.BigNumValType[]): number;
76
+ power(base: Utils.BigNumValType, exponent: Utils.BigNumValType): number;
77
+ formatRate(val: Utils.BigNumValType, unit?: string): string;
78
+ unFormatRate(val: Utils.BigNumValType): number;
77
79
  DOWN: 1;
78
80
  UP: 0;
79
81
  BigNumber: typeof import("bignumber.js").BigNumber;
80
82
  propTypes: typeof import("./utils/vuePropTypes").default;
81
- timeZoneOptions: utils.TimeZoneItem[];
83
+ timeZoneOptions: Utils.TimeZoneItem[];
82
84
  withInstall<T_7>(component: T_7, alias?: string | undefined): T_7 & import("vue").Plugin;
83
85
  toGoogleAuth(clientId: string, redirectUri: string): void;
84
86
  GoogleAuth: {
@@ -169,10 +171,10 @@ declare const JKVUEComps: {
169
171
  startCheck: () => void;
170
172
  };
171
173
  }>> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & ({
172
- readonly toGoogleAuth: typeof comps.toGoogleAuth;
174
+ readonly toGoogleAuth: typeof Comps.toGoogleAuth;
173
175
  } & import("vue").Plugin)));
174
176
  toTelegramAuth(botId: number, toPath: string): void;
175
- getTelegramAuthUrlParams(): comps.TgUserData | null;
177
+ getTelegramAuthUrlParams(): Comps.TgUserData | null;
176
178
  TelegramAuth: {
177
179
  new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
178
180
  botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
@@ -182,10 +184,10 @@ declare const JKVUEComps: {
182
184
  default: string;
183
185
  };
184
186
  }>> & {
185
- onCallback?: ((_user: comps.TgUserData) => any) | undefined;
187
+ onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
186
188
  onRejectCallback?: (() => any) | undefined;
187
189
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
188
- callback: (_user: comps.TgUserData) => true;
190
+ callback: (_user: Comps.TgUserData) => true;
189
191
  rejectCallback: () => true;
190
192
  }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
191
193
  botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
@@ -195,7 +197,7 @@ declare const JKVUEComps: {
195
197
  default: string;
196
198
  };
197
199
  }>> & {
198
- onCallback?: ((_user: comps.TgUserData) => any) | undefined;
200
+ onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
199
201
  onRejectCallback?: (() => any) | undefined;
200
202
  }, {
201
203
  botId: number;
@@ -219,7 +221,7 @@ declare const JKVUEComps: {
219
221
  default: string;
220
222
  };
221
223
  }>> & {
222
- onCallback?: ((_user: comps.TgUserData) => any) | undefined;
224
+ onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
223
225
  onRejectCallback?: (() => any) | undefined;
224
226
  }, () => JSX.Element, {}, {}, {}, {
225
227
  botId: number;
@@ -236,10 +238,10 @@ declare const JKVUEComps: {
236
238
  default: string;
237
239
  };
238
240
  }>> & {
239
- onCallback?: ((_user: comps.TgUserData) => any) | undefined;
241
+ onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
240
242
  onRejectCallback?: (() => any) | undefined;
241
243
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
242
- callback: (_user: comps.TgUserData) => true;
244
+ callback: (_user: Comps.TgUserData) => true;
243
245
  rejectCallback: () => true;
244
246
  }, string, {
245
247
  botId: number;
@@ -249,8 +251,8 @@ declare const JKVUEComps: {
249
251
  startCheck: () => void;
250
252
  };
251
253
  }>> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & ({
252
- readonly toTelegramAuth: typeof comps.toTelegramAuth;
253
- readonly getTelegramAuthUrlParams: typeof comps.getTelegramAuthUrlParams;
254
+ readonly toTelegramAuth: typeof Comps.toTelegramAuth;
255
+ readonly getTelegramAuthUrlParams: typeof Comps.getTelegramAuthUrlParams;
254
256
  } & import("vue").Plugin)));
255
257
  };
256
258
  export default JKVUEComps;
package/dist/index.js CHANGED
@@ -1,93 +1,95 @@
1
- import { c as e } from "./chunks/index-BP9Q78TM.js";
2
- import { u as s } from "./chunks/index-aaoImdl9.js";
3
- import { d as m, h as l, e as n, f as u, g as p, b as g, a as f, c as h, r as N } from "./chunks/index-aaoImdl9.js";
4
- import { GoogleAuth as c, toGoogleAuth as T } from "./components/GoogleAuth.js";
5
- import { TelegramAuth as E, getTelegramAuthUrlParams as U, toTelegramAuth as b } from "./components/TelegramAuth.js";
6
- import { is as A, isArray as B, isBoolean as D, isClient as I, isDate as O, isDef as S, isEdgeBrowser as w, isElement as L, isEmail as v, isEmpty as y, isFunction as F, isHtmlStr as G, isInMobileBrowser as R, isIp as W, isMap as q, isNull as C, isNullAndUnDef as M, isNullOrUnDef as V, isNumber as H, isObject as Z, isPromise as j, isPromiseLink as k, isRegExp as z, isServer as J, isString as K, isUnDef as Q, isUrl as X, isValidPhoneNumber as Y, isWindow as _, isZhLang as $ } from "./utils/is.js";
7
- import { BigNumber as se, DOWN as ie, UP as re, add as te, divide as oe, formatRate as ae, helper as me, isBigNum as le, isBool as ne, isEqualTo as ue, isGreaterThan as pe, isGreaterThanOrEqualTo as ge, isInt as fe, isLessThan as he, isLessThanOrEqualTo as Ne, isNanValue as de, isNum as ce, multiply as Te, power as xe, subtract as Ee, toBigNum as Ue, toDecimalPlaces as be, toInt as Pe, toLocaleString as Ae, toNum as Be, toString as De, unFormatRate as Ie } from "./utils/math.js";
8
- import { propTypes as Se } from "./utils/vuePropTypes.js";
9
- import { timeZoneOptions as Le } from "./utils/timeZone.js";
10
- import { withInstall as ye } from "./utils/withInstall.js";
11
- const t = {
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 = {
12
12
  ...e,
13
13
  ...s,
14
14
  Utils: s,
15
15
  Comps: e
16
16
  };
17
17
  export {
18
- se as BigNumber,
19
- ie as DOWN,
18
+ ie as BigNumber,
19
+ re as DOWN,
20
20
  c as GoogleAuth,
21
21
  E as TelegramAuth,
22
- re as UP,
23
- te as add,
24
- m as deepMerge,
25
- t as default,
26
- l as desensitization,
27
- oe as divide,
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
28
  n as evalPro,
29
29
  u as filterInputNum,
30
- ae as formatRate,
30
+ me as formatRate,
31
31
  p as generateFilterInputNumFn,
32
32
  g as getRouterParams,
33
- U as getTelegramAuthUrlParams,
33
+ P as getTelegramAuthUrlParams,
34
34
  f as getWebsiteUrl,
35
- me as helper,
36
- A as is,
37
- B as isArray,
38
- le as isBigNum,
39
- ne as isBool,
40
- D as isBoolean,
41
- I as isClient,
42
- O as isDate,
43
- S as isDef,
44
- w as isEdgeBrowser,
45
- L as isElement,
46
- v as isEmail,
47
- y as isEmpty,
48
- ue as isEqualTo,
49
- F as isFunction,
50
- pe as isGreaterThan,
51
- ge as isGreaterThanOrEqualTo,
52
- G as isHtmlStr,
53
- R as isInMobileBrowser,
54
- fe as isInt,
55
- W as isIp,
56
- he as isLessThan,
57
- Ne as isLessThanOrEqualTo,
58
- q as isMap,
59
- de as isNanValue,
60
- C as isNull,
61
- M as isNullAndUnDef,
62
- V as isNullOrUnDef,
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
63
  ce as isNum,
64
- H as isNumber,
65
- Z as isObject,
66
- j as isPromise,
67
- k as isPromiseLink,
68
- z as isRegExp,
69
- J as isServer,
70
- K as isString,
71
- Q as isUnDef,
72
- X as isUrl,
73
- Y as isValidPhoneNumber,
74
- _ as isWindow,
75
- $ as isZhLang,
76
- Te as multiply,
77
- xe as power,
78
- Se as propTypes,
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
79
  h as removeWhitespace,
80
80
  N as renderHtmlStr,
81
81
  Ee as subtract,
82
- Le as timeZoneOptions,
83
- Ue as toBigNum,
84
- be as toDecimalPlaces,
85
- T as toGoogleAuth,
86
- Pe as toInt,
87
- Ae as toLocaleString,
88
- Be as toNum,
89
- De as toString,
90
- b as toTelegramAuth,
91
- Ie as unFormatRate,
92
- ye as withInstall
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
93
95
  };
@@ -18,7 +18,7 @@ export declare function filterInputNum(eventVal: string | number, type?: 'int' |
18
18
  * @param type 输入类型,int整数,float,default: 'int'
19
19
  * @param maxDecimal 最大小数位,default: 6
20
20
  */
21
- export declare function generateFilterInputNumFn<T extends Record<string, any>, K extends keyof T>(obj: T, key: K, fn?: () => void, type?: 'float' | 'int', maxDecimal?: number): (e: ChangeEvent) => void;
21
+ export declare function generateFilterInputNumFn<T extends Recordable, K extends keyof T>(obj: T, key: K, fn?: () => void, type?: 'float' | 'int', maxDecimal?: number): (e: ChangeEvent) => void;
22
22
  /** 渲染Html字符串片段 */
23
23
  export declare function renderHtmlStr(html: string): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
24
  [key: string]: any;
@@ -45,3 +45,10 @@ export declare function desensitization(str?: string | number, number?: number,
45
45
  showSuffix?: boolean;
46
46
  middleStr?: string;
47
47
  }): string | undefined;
48
+ /** 数字转为样式单位
49
+ * @param str 值
50
+ * @param unit 单位,default: 'px'
51
+ */
52
+ export declare function toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
53
+ /** 数字转为样式对象 */
54
+ export declare function toStyleObject(style?: string | Recordable | null): Recordable<any>;
@@ -1,10 +1,10 @@
1
1
  import "vue";
2
- import { is as r, isArray as t, isBoolean as o, isClient as a, isDate as n, isDef as l, isEdgeBrowser as m, isElement as u, isEmail as p, isEmpty as g, isFunction as N, isHtmlStr as f, isInMobileBrowser as d, isIp as h, isMap as b, isNull as c, isNullAndUnDef as E, isNullOrUnDef as T, isNumber as x, isObject as B, isPromise as D, isPromiseLink as I, isRegExp as P, isServer as O, isString as S, isUnDef as U, isUrl as w, isValidPhoneNumber as L, isWindow as v, isZhLang as y } from "./is.js";
3
- import { BigNumber as R, DOWN as W, UP as q, add as M, divide as A, formatRate as G, helper as H, isBigNum as V, isBool as Z, isEqualTo as j, isGreaterThan as k, isGreaterThanOrEqualTo as z, isInt as C, isLessThan as J, isLessThanOrEqualTo as K, isNanValue as Q, isNum as X, multiply as Y, power as _, subtract as $, toBigNum as ee, toDecimalPlaces as ie, toInt as se, toLocaleString as re, toNum as te, toString as oe, unFormatRate as ae } from "./math.js";
2
+ import { is as t, isArray as r, isBoolean as o, isClient as a, isDate as n, isDef as l, isEdgeBrowser as m, isElement as u, isEmail as p, isEmpty as g, isFunction as N, isHtmlStr as f, isInMobileBrowser as d, isIp as h, isMap as b, isNull as c, isNullAndUnDef as E, isNullOrUnDef as S, isNumber as T, isObject as x, isPromise as B, isPromiseLink as D, isRegExp as I, isServer as O, isString as P, isUnDef as U, isUrl as y, isValidPhoneNumber as w, isWindow as L, isZhLang as v } from "./is.js";
3
+ import { BigNumber as R, DOWN as W, UP as q, add as M, divide as j, formatRate as A, helper as G, isBigNum as H, isBool as V, isEqualTo as Z, isGreaterThan as k, isGreaterThanOrEqualTo as z, isInt as C, isLessThan as J, isLessThanOrEqualTo as K, isNanValue as Q, isNum as X, multiply as Y, power as _, subtract as $, toBigNum as ee, toDecimalPlaces as ie, toInt as se, toLocaleString as te, toNum as re, toString as oe, unFormatRate as ae } from "./math.js";
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 Te, c as xe, r as Be } from "../chunks/index-aaoImdl9.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";
8
8
  export {
9
9
  R as BigNumber,
10
10
  W as DOWN,
@@ -12,18 +12,18 @@ export {
12
12
  M as add,
13
13
  fe as deepMerge,
14
14
  de as desensitization,
15
- A as divide,
15
+ j as divide,
16
16
  he as evalPro,
17
17
  be as filterInputNum,
18
- G as formatRate,
18
+ A as formatRate,
19
19
  ce as generateFilterInputNumFn,
20
20
  Ee as getRouterParams,
21
- Te as getWebsiteUrl,
22
- H as helper,
23
- r as is,
24
- t as isArray,
25
- V as isBigNum,
26
- Z as isBool,
21
+ Se as getWebsiteUrl,
22
+ G as helper,
23
+ t as is,
24
+ r as isArray,
25
+ H as isBigNum,
26
+ V as isBool,
27
27
  o as isBoolean,
28
28
  a as isClient,
29
29
  n as isDate,
@@ -32,7 +32,7 @@ export {
32
32
  u as isElement,
33
33
  p as isEmail,
34
34
  g as isEmpty,
35
- j as isEqualTo,
35
+ Z as isEqualTo,
36
36
  N as isFunction,
37
37
  k as isGreaterThan,
38
38
  z as isGreaterThanOrEqualTo,
@@ -46,33 +46,35 @@ export {
46
46
  Q as isNanValue,
47
47
  c as isNull,
48
48
  E as isNullAndUnDef,
49
- T as isNullOrUnDef,
49
+ S as isNullOrUnDef,
50
50
  X as isNum,
51
- x as isNumber,
52
- B as isObject,
53
- D as isPromise,
54
- I as isPromiseLink,
55
- P as isRegExp,
51
+ T as isNumber,
52
+ x as isObject,
53
+ B as isPromise,
54
+ D as isPromiseLink,
55
+ I as isRegExp,
56
56
  O as isServer,
57
- S as isString,
57
+ P as isString,
58
58
  U as isUnDef,
59
- w as isUrl,
60
- L as isValidPhoneNumber,
61
- v as isWindow,
62
- y as isZhLang,
59
+ y as isUrl,
60
+ w as isValidPhoneNumber,
61
+ L as isWindow,
62
+ v as isZhLang,
63
63
  Y as multiply,
64
64
  _ as power,
65
65
  le as propTypes,
66
- xe as removeWhitespace,
67
- Be as renderHtmlStr,
66
+ Te as removeWhitespace,
67
+ xe as renderHtmlStr,
68
68
  $ as subtract,
69
69
  ue as timeZoneOptions,
70
70
  ee as toBigNum,
71
71
  ie as toDecimalPlaces,
72
72
  se as toInt,
73
- re as toLocaleString,
74
- te as toNum,
73
+ te as toLocaleString,
74
+ re as toNum,
75
75
  oe as toString,
76
+ Be as toStyleObject,
77
+ De as toStyleUnit,
76
78
  ae as unFormatRate,
77
79
  ge as withInstall
78
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jk-vue-comps",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "jk-vue-comps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,157 +0,0 @@
1
- import { nextTick as p, createVNode as h } from "vue";
2
- import { isString as u, isHtmlStr as l, isObject as f, isNumber as c, is as w, isArray as N, isBoolean as S, isClient as b, isDate as x, isDef as O, isEdgeBrowser as $, isElement as P, isEmail as T, isEmpty as v, isFunction as y, isInMobileBrowser as E, isIp as B, isMap as I, isNull as L, isNullAndUnDef as U, isNullOrUnDef as D, isPromise as q, isPromiseLink as F, isRegExp as M, isServer as R, isUnDef as k, isUrl as W, isValidPhoneNumber as _, isWindow as j, isZhLang as z } from "../utils/is.js";
3
- import { BigNumber as H, DOWN as V, UP as A, add as G, divide as Z, formatRate as C, helper as J, isBigNum as K, isBool as Q, isEqualTo as X, isGreaterThan as Y, isGreaterThanOrEqualTo as ee, isInt as ie, isLessThan as te, isLessThanOrEqualTo as re, isNanValue as ne, isNum as se, multiply as oe, power as ue, subtract as ae, toBigNum as le, toDecimalPlaces as fe, toInt as ce, toLocaleString as me, toNum as ge, toString as de, unFormatRate as pe } from "../utils/math.js";
4
- import { propTypes as he } from "../utils/vuePropTypes.js";
5
- import { timeZoneOptions as we } from "../utils/timeZone.js";
6
- import { withInstall as Ne } from "../utils/withInstall.js";
7
- function a(i) {
8
- try {
9
- return new Function(`'use strict'; return (${i});`)();
10
- } catch {
11
- return null;
12
- }
13
- }
14
- function m(i, r = "float", t = 6) {
15
- let e = String(i);
16
- if (e = e.replace(/(^\s*)|(\s*$)/g, ""), e !== "") {
17
- const s = e.indexOf("0") === 0 && e.length > 1 && e.indexOf(".") !== 1, n = r === "int" ? /[^\d]/g : /[^\d.]/g;
18
- if (e = e.replace(n, ""), s)
19
- return "0";
20
- if (r === "int")
21
- e = e.indexOf("0") === 0 && e.length > 1 ? e.substring(0, e.length - 1) : e;
22
- else {
23
- const o = a(`/\\.{${t},}/g`), d = a(`/^(\\d?)+(\\.\\d{0,${t}})?$/`);
24
- e.indexOf(".") === 0 ? (e = "", e = e.replace(/[^$#$]/g, "0."), e = e.replace(o, ".")) : d.test(e) || (e = e.substring(0, e.length - 1));
25
- }
26
- }
27
- return e;
28
- }
29
- function Se(i, r, t, e = "int", s = 6) {
30
- return (n) => {
31
- p().then(() => {
32
- var o;
33
- i[r] = m((o = n == null ? void 0 : n.target) == null ? void 0 : o.value, e, s), t == null || t();
34
- });
35
- };
36
- }
37
- function be(i) {
38
- return !u(i) || !l(i) ? i : h("div", { innerHTML: i });
39
- }
40
- function xe() {
41
- return window ? `${window.location.protocol}//${window.location.hostname}` : "";
42
- }
43
- function Oe() {
44
- const i = new URLSearchParams(window.location.search);
45
- if (!i.size)
46
- return;
47
- const r = {};
48
- for (const [t, e] of i.entries())
49
- r[t] = e;
50
- return r;
51
- }
52
- function $e(i) {
53
- return u(i) ? i.replace(/\s+/g, "") : "";
54
- }
55
- function g(i = {}, r = {}) {
56
- let t;
57
- for (t in r)
58
- i[t] = f(i[t]) ? g(i[t], r[t]) : i[t] = r[t];
59
- return i;
60
- }
61
- function Pe(i, r = 6, t = {
62
- showPrefix: !0,
63
- showSuffix: !0,
64
- middleStr: "****"
65
- }) {
66
- if (!u(i) && !c(i))
67
- return i;
68
- const e = String(i), s = (e == null ? void 0 : e.length) ?? 0;
69
- if (!e || !s || r <= 0)
70
- return e;
71
- const n = t.showPrefix ? e.substring(0, r) : "", o = t.showSuffix ? e.substring(s - r) : "";
72
- return `${n}${t.middleStr}${o}`;
73
- }
74
- const Le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
- __proto__: null,
76
- BigNumber: H,
77
- DOWN: V,
78
- UP: A,
79
- add: G,
80
- deepMerge: g,
81
- desensitization: Pe,
82
- divide: Z,
83
- evalPro: a,
84
- filterInputNum: m,
85
- formatRate: C,
86
- generateFilterInputNumFn: Se,
87
- getRouterParams: Oe,
88
- getWebsiteUrl: xe,
89
- helper: J,
90
- is: w,
91
- isArray: N,
92
- isBigNum: K,
93
- isBool: Q,
94
- isBoolean: S,
95
- isClient: b,
96
- isDate: x,
97
- isDef: O,
98
- isEdgeBrowser: $,
99
- isElement: P,
100
- isEmail: T,
101
- isEmpty: v,
102
- isEqualTo: X,
103
- isFunction: y,
104
- isGreaterThan: Y,
105
- isGreaterThanOrEqualTo: ee,
106
- isHtmlStr: l,
107
- isInMobileBrowser: E,
108
- isInt: ie,
109
- isIp: B,
110
- isLessThan: te,
111
- isLessThanOrEqualTo: re,
112
- isMap: I,
113
- isNanValue: ne,
114
- isNull: L,
115
- isNullAndUnDef: U,
116
- isNullOrUnDef: D,
117
- isNum: se,
118
- isNumber: c,
119
- isObject: f,
120
- isPromise: q,
121
- isPromiseLink: F,
122
- isRegExp: M,
123
- isServer: R,
124
- isString: u,
125
- isUnDef: k,
126
- isUrl: W,
127
- isValidPhoneNumber: _,
128
- isWindow: j,
129
- isZhLang: z,
130
- multiply: oe,
131
- power: ue,
132
- propTypes: he,
133
- removeWhitespace: $e,
134
- renderHtmlStr: be,
135
- subtract: ae,
136
- timeZoneOptions: we,
137
- toBigNum: le,
138
- toDecimalPlaces: fe,
139
- toInt: ce,
140
- toLocaleString: me,
141
- toNum: ge,
142
- toString: de,
143
- unFormatRate: pe,
144
- withInstall: Ne
145
- }, Symbol.toStringTag, { value: "Module" }));
146
- export {
147
- xe as a,
148
- Oe as b,
149
- $e as c,
150
- g as d,
151
- a as e,
152
- m as f,
153
- Se as g,
154
- Pe as h,
155
- be as r,
156
- Le as u
157
- };