jk-vue-comps 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts DELETED
@@ -1,269 +0,0 @@
1
- import * as Comps from './components';
2
- import * as Hooks from './hooks';
3
- import * as Utils from './utils';
4
- export * from './components';
5
- export * from './utils';
6
- declare const JKVUEComps: {
7
- Comps: typeof Comps;
8
- Hooks: typeof Hooks;
9
- Utils: typeof Utils;
10
- evalPro(str: string): any;
11
- filterInputNum(eventVal: string | number, type?: "int" | "float", maxDecimal?: number): string;
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;
13
- renderHtmlStr(html: string): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
14
- [key: string]: any;
15
- }>;
16
- getWebsiteUrl(): string;
17
- getRouterParams(): Recordable<any> | undefined;
18
- removeWhitespace(str: any): string;
19
- deepMerge<T_1 = any>(src?: any, target?: any): T_1;
20
- desensitization(str?: string | number | undefined, number?: number, { showPrefix, showSuffix, middleStr }?: {
21
- showPrefix?: boolean | undefined;
22
- showSuffix?: boolean | undefined;
23
- middleStr?: string | undefined;
24
- }): string | undefined;
25
- toStyleUnit(str?: string | number | null | undefined, unit?: string): string | undefined;
26
- toStyleObject(style?: string | Recordable<any> | null | undefined): Recordable<any>;
27
- is(val: unknown, type: string): boolean;
28
- isDef<T_2 = unknown>(val?: T_2 | undefined): val is T_2;
29
- isUnDef<T_3 = unknown>(val?: T_3 | undefined): val is T_3;
30
- isObject(val: any): val is Record<any, any>;
31
- isDate(val: unknown): val is Date;
32
- isNull(val: unknown): val is null;
33
- isNullAndUnDef(val: unknown): val is null | undefined;
34
- isNullOrUnDef(val: unknown): val is null | undefined;
35
- isNumber(val: unknown): val is number;
36
- isString(val: unknown): val is string;
37
- isFunction(val: unknown): val is Function;
38
- isBoolean(val: unknown): val is boolean;
39
- isRegExp(val: unknown): val is RegExp;
40
- isArray(val: any): val is any[];
41
- isEmpty<T_4 = unknown>(val: T_4): val is T_4;
42
- isPromise<T_5 = any>(val: unknown): val is Promise<T_5>;
43
- isPromiseLink<T_6>(it: T_6 | PromiseLike<T_6>): it is PromiseLike<T_6>;
44
- isWindow(val: any): val is Window;
45
- isElement(val: unknown): val is Element;
46
- isMap(val: unknown): val is Map<any, any>;
47
- isUrl(path: string): boolean;
48
- isValidPhoneNumber(phoneNumber: string): boolean;
49
- isInMobileBrowser(): false | RegExpMatchArray | null;
50
- isZhLang(lang: string): boolean;
51
- isEdgeBrowser(): boolean;
52
- isServer: boolean;
53
- isClient: boolean;
54
- isIp: (ip: string) => boolean;
55
- isEmail: (email: string) => boolean;
56
- isHtmlStr: (str: string) => boolean;
57
- helper(val: Utils.BigNumValType): import("bignumber.js").BigNumber;
58
- isBool(val: any): val is boolean;
59
- isBigNum(val: any): val is import("bignumber.js").BigNumber;
60
- isNum(val: any): val is number;
61
- isNanValue(val: any): boolean;
62
- isInt(val: any): boolean;
63
- isGreaterThan(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
64
- isLessThan(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
65
- isEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
66
- isGreaterThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
67
- isLessThanOrEqualTo(num1: import("bignumber.js").BigNumber.Value, num2: import("bignumber.js").BigNumber.Value): boolean;
68
- toBigNum(val: Utils.BigNumValType): import("bignumber.js").BigNumber;
69
- toNum(val: Utils.BigNumValType): number;
70
- toInt(val: Utils.BigNumValType, isUp?: boolean): number;
71
- toString(val: Utils.BigNumValType): string;
72
- toDecimalPlaces(val: Utils.BigNumValType, decimal?: number | undefined, isUp?: boolean): number;
73
- toLocaleString(val: Utils.BigNumValType): string;
74
- add(...vals: Utils.BigNumValType[]): number;
75
- subtract(...vals: Utils.BigNumValType[]): number;
76
- multiply(...vals: Utils.BigNumValType[]): number;
77
- divide(...vals: Utils.BigNumValType[]): number;
78
- power(base: Utils.BigNumValType, exponent: Utils.BigNumValType): number;
79
- formatRate(val: Utils.BigNumValType, unit?: string): string;
80
- unFormatRate(val: Utils.BigNumValType): number;
81
- DOWN: 1;
82
- UP: 0;
83
- BigNumber: typeof import("bignumber.js").BigNumber;
84
- propTypes: typeof import("./utils/vuePropTypes").default;
85
- timeZoneOptions: Utils.TimeZoneItem[];
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>;
96
- toGoogleAuth(clientId: string, redirectUri: string): void;
97
- GoogleAuth: {
98
- new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
99
- clientId: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
100
- default: string;
101
- };
102
- redirectUri: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
103
- default: string;
104
- };
105
- }>> & {
106
- onCallback?: ((_data: {
107
- code: string;
108
- }) => any) | undefined;
109
- onRejectCallback?: ((_data: any) => any) | undefined;
110
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
111
- callback: (_data: {
112
- code: string;
113
- }) => true;
114
- rejectCallback: (_data: any) => true;
115
- }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
116
- clientId: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
117
- default: string;
118
- };
119
- redirectUri: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
120
- default: string;
121
- };
122
- }>> & {
123
- onCallback?: ((_data: {
124
- code: string;
125
- }) => any) | undefined;
126
- onRejectCallback?: ((_data: any) => any) | undefined;
127
- }, {
128
- clientId: string;
129
- redirectUri: string;
130
- }, true, {}, import("vue").SlotsType<{
131
- default: {
132
- startCheck: () => void;
133
- };
134
- }>, {
135
- P: {};
136
- B: {};
137
- D: {};
138
- C: {};
139
- M: {};
140
- Defaults: {};
141
- }, Readonly<import("vue").ExtractPropTypes<{
142
- clientId: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
143
- default: string;
144
- };
145
- redirectUri: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
146
- default: string;
147
- };
148
- }>> & {
149
- onCallback?: ((_data: {
150
- code: string;
151
- }) => any) | undefined;
152
- onRejectCallback?: ((_data: any) => any) | undefined;
153
- }, () => JSX.Element, {}, {}, {}, {
154
- clientId: string;
155
- redirectUri: string;
156
- }>;
157
- __isFragment?: undefined;
158
- __isTeleport?: undefined;
159
- __isSuspense?: undefined;
160
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
161
- clientId: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
162
- default: string;
163
- };
164
- redirectUri: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
165
- default: string;
166
- };
167
- }>> & {
168
- onCallback?: ((_data: {
169
- code: string;
170
- }) => any) | undefined;
171
- onRejectCallback?: ((_data: any) => any) | undefined;
172
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
173
- callback: (_data: {
174
- code: string;
175
- }) => true;
176
- rejectCallback: (_data: any) => true;
177
- }, string, {
178
- clientId: string;
179
- redirectUri: string;
180
- }, {}, string, import("vue").SlotsType<{
181
- default: {
182
- startCheck: () => void;
183
- };
184
- }>> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & ({
185
- readonly toGoogleAuth: typeof Comps.toGoogleAuth;
186
- } & import("vue").Plugin)));
187
- toTelegramAuth(botId: number, toPath: string): void;
188
- getTelegramAuthUrlParams(): Comps.TgUserData | null;
189
- TelegramAuth: {
190
- new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
191
- botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
192
- default: number;
193
- };
194
- toPath: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
195
- default: string;
196
- };
197
- }>> & {
198
- onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
199
- onRejectCallback?: (() => any) | undefined;
200
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
201
- callback: (_user: Comps.TgUserData) => true;
202
- rejectCallback: () => true;
203
- }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
204
- botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
205
- default: number;
206
- };
207
- toPath: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
208
- default: string;
209
- };
210
- }>> & {
211
- onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
212
- onRejectCallback?: (() => any) | undefined;
213
- }, {
214
- botId: number;
215
- toPath: string;
216
- }, true, {}, import("vue").SlotsType<{
217
- default: {
218
- startCheck: () => void;
219
- };
220
- }>, {
221
- P: {};
222
- B: {};
223
- D: {};
224
- C: {};
225
- M: {};
226
- Defaults: {};
227
- }, Readonly<import("vue").ExtractPropTypes<{
228
- botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
229
- default: number;
230
- };
231
- toPath: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
232
- default: string;
233
- };
234
- }>> & {
235
- onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
236
- onRejectCallback?: (() => any) | undefined;
237
- }, () => JSX.Element, {}, {}, {}, {
238
- botId: number;
239
- toPath: string;
240
- }>;
241
- __isFragment?: undefined;
242
- __isTeleport?: undefined;
243
- __isSuspense?: undefined;
244
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
245
- botId: import("vue-types").VueTypeValidableDef<number, import("node_modules/vue-types/dist/types").ValidatorFunction<number>> & {
246
- default: number;
247
- };
248
- toPath: import("vue-types").VueTypeValidableDef<string, import("node_modules/vue-types/dist/types").ValidatorFunction<string>> & {
249
- default: string;
250
- };
251
- }>> & {
252
- onCallback?: ((_user: Comps.TgUserData) => any) | undefined;
253
- onRejectCallback?: (() => any) | undefined;
254
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
255
- callback: (_user: Comps.TgUserData) => true;
256
- rejectCallback: () => true;
257
- }, string, {
258
- botId: number;
259
- toPath: string;
260
- }, {}, string, import("vue").SlotsType<{
261
- default: {
262
- startCheck: () => void;
263
- };
264
- }>> & (import("vue").VNodeProps & (import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & ({
265
- readonly toTelegramAuth: typeof Comps.toTelegramAuth;
266
- readonly getTelegramAuthUrlParams: typeof Comps.getTelegramAuthUrlParams;
267
- } & import("vue").Plugin)));
268
- };
269
- export default JKVUEComps;
package/dist/index.js DELETED
@@ -1,98 +0,0 @@
1
- import { C as e } from "./chunks/index-DyiqKziC.js";
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 = {
13
- ...e,
14
- ...s,
15
- ...t,
16
- Comps: e,
17
- Hooks: s,
18
- Utils: t
19
- };
20
- export {
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
98
- };
@@ -1,54 +0,0 @@
1
- export * from './is';
2
- export * from './math';
3
- export * from './vuePropTypes';
4
- export * from './timeZone';
5
- export * from './withInstall';
6
- /** 代替eval方法 */
7
- export declare function evalPro(str: string): any;
8
- /** 数字输入过滤
9
- * @param eventVal 输入的值
10
- * @param type 输入类型,int整数,float,default: 'int'
11
- * @param maxDecimal 最大小数位,default: 6
12
- */
13
- export declare function filterInputNum(eventVal: string | number, type?: 'int' | 'float', maxDecimal?: number): string;
14
- /** 生成输入数字过滤函数
15
- * @param obj 对象
16
- * @param key 对象里面的字段名
17
- * @param fn 输入过滤之后执行的函数
18
- * @param type 输入类型,int整数,float,default: 'int'
19
- * @param maxDecimal 最大小数位,default: 6
20
- */
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
- /** 渲染Html字符串片段 */
23
- export declare function renderHtmlStr(html: string): string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
- [key: string]: any;
25
- }>;
26
- /** 获取当前网站协议+域名 */
27
- export declare function getWebsiteUrl(): string;
28
- /** 获取路由参数 */
29
- export declare function getRouterParams(): Recordable<any> | undefined;
30
- /** 去除字符串里的所有空字符 */
31
- export declare function removeWhitespace(str: any): string;
32
- /** 深度合并 */
33
- export declare function deepMerge<T = any>(src?: any, target?: any): T;
34
- /** 字符串脱敏
35
- * @param str 值
36
- * @param number 可见的字符数,default: 6
37
- * @param options = {
38
- * showPrefix 显示前缀字符,default: true
39
- * showSuffix 显示后缀字符,default: true
40
- * middleStr 中间的字符串,default: '****'
41
- * }
42
- */
43
- export declare function desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
44
- showPrefix?: boolean;
45
- showSuffix?: boolean;
46
- middleStr?: string;
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,80 +0,0 @@
1
- import "vue";
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
- import { propTypes as le } from "./vuePropTypes.js";
5
- import { timeZoneOptions as ue } from "./timeZone.js";
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-ChgNR2U8.js";
8
- export {
9
- R as BigNumber,
10
- W as DOWN,
11
- q as UP,
12
- M as add,
13
- fe as deepMerge,
14
- de as desensitization,
15
- j as divide,
16
- he as evalPro,
17
- be as filterInputNum,
18
- A as formatRate,
19
- ce as generateFilterInputNumFn,
20
- Ee as getRouterParams,
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
- o as isBoolean,
28
- a as isClient,
29
- n as isDate,
30
- l as isDef,
31
- m as isEdgeBrowser,
32
- u as isElement,
33
- p as isEmail,
34
- g as isEmpty,
35
- Z as isEqualTo,
36
- N as isFunction,
37
- k as isGreaterThan,
38
- z as isGreaterThanOrEqualTo,
39
- f as isHtmlStr,
40
- d as isInMobileBrowser,
41
- C as isInt,
42
- h as isIp,
43
- J as isLessThan,
44
- K as isLessThanOrEqualTo,
45
- b as isMap,
46
- Q as isNanValue,
47
- c as isNull,
48
- E as isNullAndUnDef,
49
- S as isNullOrUnDef,
50
- X as isNum,
51
- T as isNumber,
52
- x as isObject,
53
- B as isPromise,
54
- D as isPromiseLink,
55
- I as isRegExp,
56
- O as isServer,
57
- P as isString,
58
- U as isUnDef,
59
- y as isUrl,
60
- w as isValidPhoneNumber,
61
- L as isWindow,
62
- v as isZhLang,
63
- Y as multiply,
64
- _ as power,
65
- le as propTypes,
66
- Te as removeWhitespace,
67
- xe as renderHtmlStr,
68
- $ as subtract,
69
- ue as timeZoneOptions,
70
- ee as toBigNum,
71
- ie as toDecimalPlaces,
72
- se as toInt,
73
- te as toLocaleString,
74
- re as toNum,
75
- oe as toString,
76
- Be as toStyleObject,
77
- De as toStyleUnit,
78
- ae as unFormatRate,
79
- ge as withInstall
80
- };
@@ -1,59 +0,0 @@
1
- export declare function is(val: unknown, type: string): boolean;
2
- /** 是否undefined */
3
- export declare function isDef<T = unknown>(val?: T): val is T;
4
- /** 是否不是undefined */
5
- export declare function isUnDef<T = unknown>(val?: T): val is T;
6
- /** 是否对象 */
7
- export declare function isObject(val: any): val is Record<any, any>;
8
- /** 是否Date */
9
- export declare function isDate(val: unknown): val is Date;
10
- /** 是否null */
11
- export declare function isNull(val: unknown): val is null;
12
- /** 是否null && 不是undefined */
13
- export declare function isNullAndUnDef(val: unknown): val is null | undefined;
14
- /** 是否null || 不是undefined */
15
- export declare function isNullOrUnDef(val: unknown): val is null | undefined;
16
- /** 是否数字(NaN也是数字) */
17
- export declare function isNumber(val: unknown): val is number;
18
- /** 是否字符串 */
19
- export declare function isString(val: unknown): val is string;
20
- /** 是否函数 */
21
- export declare function isFunction(val: unknown): val is Function;
22
- /** 是否布尔 */
23
- export declare function isBoolean(val: unknown): val is boolean;
24
- /** 是否正则 */
25
- export declare function isRegExp(val: unknown): val is RegExp;
26
- /** 是否数组 */
27
- export declare function isArray(val: any): val is Array<any>;
28
- /** 是否空 */
29
- export declare function isEmpty<T = unknown>(val: T): val is T;
30
- /** 是否Promise */
31
- export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
32
- /** 是否PromiseLink */
33
- export declare function isPromiseLink<T>(it: T | PromiseLike<T>): it is PromiseLike<T>;
34
- /** 是否Window */
35
- export declare function isWindow(val: any): val is Window;
36
- /** 是否Element */
37
- export declare function isElement(val: unknown): val is Element;
38
- /** 是否Map */
39
- export declare function isMap(val: unknown): val is Map<any, any>;
40
- /** 是否服务端渲染,没有window对象 */
41
- export declare const isServer: boolean;
42
- /** 是否客户端,window对象不为undefined */
43
- export declare const isClient: boolean;
44
- /** 是否url */
45
- export declare function isUrl(path: string): boolean;
46
- /** 是否Ip */
47
- export declare const isIp: (ip: string) => boolean;
48
- /** 是否邮箱 */
49
- export declare const isEmail: (email: string) => boolean;
50
- /** 是否号码 */
51
- export declare function isValidPhoneNumber(phoneNumber: string): boolean;
52
- /** 是否移动端浏览器 */
53
- export declare function isInMobileBrowser(): false | RegExpMatchArray | null;
54
- /** 是否中文 */
55
- export declare function isZhLang(lang: string): boolean;
56
- /** 是否Edge浏览器 */
57
- export declare function isEdgeBrowser(): boolean;
58
- /** 是否html字符串 */
59
- export declare const isHtmlStr: (str: string) => boolean;
package/dist/utils/is.js DELETED
@@ -1,120 +0,0 @@
1
- function e(n, t) {
2
- return Object.prototype.toString.call(n) === `[object ${t}]`;
3
- }
4
- function p(n) {
5
- return typeof n < "u";
6
- }
7
- function c(n) {
8
- return !p(n);
9
- }
10
- function u(n) {
11
- return n !== null && e(n, "Object");
12
- }
13
- function m(n) {
14
- return e(n, "Date");
15
- }
16
- function d(n) {
17
- return n === null;
18
- }
19
- function l(n) {
20
- return c(n) && d(n);
21
- }
22
- function y(n) {
23
- return c(n) || d(n);
24
- }
25
- function A(n) {
26
- return e(n, "Number");
27
- }
28
- function a(n) {
29
- return e(n, "String");
30
- }
31
- function f(n) {
32
- return typeof n == "function";
33
- }
34
- function h(n) {
35
- return e(n, "Boolean");
36
- }
37
- function E(n) {
38
- return e(n, "RegExp");
39
- }
40
- function w(n) {
41
- return n && Array.isArray(n);
42
- }
43
- 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;
45
- }
46
- function P(n) {
47
- return e(n, "Promise") && u(n) && f(n.then) && f(n.catch);
48
- }
49
- function S(n) {
50
- return n instanceof Promise || typeof (n == null ? void 0 : n.then) == "function";
51
- }
52
- function Z(n) {
53
- return typeof window < "u" && e(n, "Window");
54
- }
55
- function D(n) {
56
- return u(n) && !!n.tagName;
57
- }
58
- function M(n) {
59
- return e(n, "Map");
60
- }
61
- const b = typeof window > "u", O = !b;
62
- function $(n) {
63
- return /^(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?(\/#\/)?(?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(n);
64
- }
65
- const x = (n) => /\b(?:\d{1,3}.){3}\d{1,3}\b/.test(n), z = (n) => /^(([^<>()[\]\\.,;:\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);
66
- function B(n) {
67
- const t = /^1[3456789]\d{9}$/, r = /^(\d{3,4}-)?\d{7,8}$/;
68
- return !!(t.test(n) || r.test(n));
69
- }
70
- function U() {
71
- return typeof navigator < "u" && navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i);
72
- }
73
- function j(n) {
74
- var i, s;
75
- const t = (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"];
76
- return r.some((o) => o === t) || !g.some((o) => o === t);
77
- }
78
- function H() {
79
- var t;
80
- if (navigator.userAgent.indexOf("Edge") > -1)
81
- return !0;
82
- const n = ((t = navigator == null ? void 0 : navigator.userAgentData) == null ? void 0 : t.brands) ?? [];
83
- for (const r of n)
84
- if ((r == null ? void 0 : r.brand) === "Microsoft Edge")
85
- return !0;
86
- return !1;
87
- }
88
- const _ = (n) => a(n) && /<[^>]+>/g.test(n);
89
- export {
90
- e as is,
91
- w as isArray,
92
- h as isBoolean,
93
- O as isClient,
94
- m as isDate,
95
- p as isDef,
96
- H as isEdgeBrowser,
97
- D as isElement,
98
- z as isEmail,
99
- N as isEmpty,
100
- f as isFunction,
101
- _ as isHtmlStr,
102
- U as isInMobileBrowser,
103
- x as isIp,
104
- M as isMap,
105
- d as isNull,
106
- l as isNullAndUnDef,
107
- y as isNullOrUnDef,
108
- A as isNumber,
109
- u as isObject,
110
- P as isPromise,
111
- S as isPromiseLink,
112
- E as isRegExp,
113
- b as isServer,
114
- a as isString,
115
- c as isUnDef,
116
- $ as isUrl,
117
- B as isValidPhoneNumber,
118
- Z as isWindow,
119
- j as isZhLang
120
- };