jk-vue-comps 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/chunks/{math-BbxxKXFw.js → math-Dcn-34Qj.js} +1 -1
  2. package/dist/components/GoogleAuth.d.ts +1 -83
  3. package/dist/components/GoogleAuth.js +0 -1
  4. package/dist/components/TelegramAuth.d.ts +1 -88
  5. package/dist/components/TelegramAuth.js +0 -1
  6. package/dist/components/index.d.ts +1 -2
  7. package/dist/components/index.js +0 -1
  8. package/dist/hooks/index.d.ts +1 -3
  9. package/dist/hooks/useCopyToClipboard.d.ts +1 -9
  10. package/dist/hooks/useFormKeypressEnter.d.ts +1 -2
  11. package/dist/hooks/useMemo.d.ts +1 -2
  12. package/dist/index.d.ts +1 -226
  13. package/dist/index.js +1 -1
  14. package/dist/src/components/GoogleAuth.d.ts +83 -0
  15. package/dist/src/components/TelegramAuth.d.ts +88 -0
  16. package/dist/src/components/index.d.ts +2 -0
  17. package/dist/src/hooks/index.d.ts +3 -0
  18. package/dist/src/hooks/useCopyToClipboard.d.ts +9 -0
  19. package/dist/src/hooks/useFormKeypressEnter.d.ts +2 -0
  20. package/dist/src/hooks/useMemo.d.ts +2 -0
  21. package/dist/src/index.d.ts +226 -0
  22. package/dist/src/utils/index.d.ts +55 -0
  23. package/dist/src/utils/is.d.ts +59 -0
  24. package/dist/src/utils/lodash.d.ts +39 -0
  25. package/dist/src/utils/math.d.ts +113 -0
  26. package/dist/src/utils/timeZone.d.ts +9 -0
  27. package/dist/src/utils/vuePropTypes.d.ts +17 -0
  28. package/dist/src/utils/withInstall.d.ts +3 -0
  29. package/dist/utils/index.d.ts +1 -55
  30. package/dist/utils/index.js +1 -1
  31. package/dist/utils/is.d.ts +1 -59
  32. package/dist/utils/lodash.d.ts +1 -39
  33. package/dist/utils/math.d.ts +1 -113
  34. package/dist/utils/math.js +1 -1
  35. package/dist/utils/timeZone.d.ts +1 -9
  36. package/dist/utils/vuePropTypes.d.ts +1 -17
  37. package/dist/utils/withInstall.d.ts +1 -3
  38. package/package.json +6 -6
@@ -0,0 +1,2 @@
1
+ import { Ref, WatchSource } from 'vue';
2
+ export declare function useMemo<T>(getValue: () => T, condition: (WatchSource<unknown> | object)[], shouldUpdate?: (prev: any[], next: any[]) => boolean): Ref<T, T>;
@@ -0,0 +1,226 @@
1
+ import { VNode, RendererNode, RendererElement, Plugin, Ref, WatchSource, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
2
+ import { BigNumber } from 'bignumber.js';
3
+ import { default as __DTS_DEFAULT_0__ } from './utils/vuePropTypes';
4
+ import * as Comps from './components';
5
+ import * as Hooks from './hooks';
6
+ import * as Utils from './utils';
7
+ export * from './components';
8
+ export * from './hooks';
9
+ export * from './utils';
10
+ declare const JKVUEComps: {
11
+ Comps: typeof Comps;
12
+ Hooks: typeof Hooks;
13
+ Utils: typeof Utils;
14
+ evalPro(str: string): any;
15
+ filterInputNum(eventVal: string | number, type?: "int" | "float", maxDecimal?: number): string;
16
+ generateFilterInputNumFn<T extends Recordable, K extends keyof T>(obj: T, key: K, fn?: () => void, type?: "float" | "int", maxDecimal?: number): (e: ChangeEvent) => void;
17
+ renderHtmlStr(html: string): string | VNode<RendererNode, RendererElement, {
18
+ [key: string]: any;
19
+ }>;
20
+ getWebsiteUrl(): string;
21
+ getRouterParams(): Recordable<any> | undefined;
22
+ removeWhitespace(str: any): string;
23
+ deepMerge<T = any>(src?: any, target?: any): T;
24
+ desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
25
+ showPrefix?: boolean;
26
+ showSuffix?: boolean;
27
+ middleStr?: string;
28
+ }): string | undefined;
29
+ toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
30
+ toStyleObject(style?: string | Recordable | null): Recordable<any>;
31
+ is(val: unknown, type: string): boolean;
32
+ isDef<T = unknown>(val?: T): val is T;
33
+ isUnDef<T = unknown>(val?: T): val is T;
34
+ isObject(val: any): val is Record<any, any>;
35
+ isDate(val: unknown): val is Date;
36
+ isNull(val: unknown): val is null;
37
+ isNullAndUnDef(val: unknown): val is null | undefined;
38
+ isNullOrUnDef(val: unknown): val is null | undefined;
39
+ isNumber(val: unknown): val is number;
40
+ isString(val: unknown): val is string;
41
+ isFunction(val: unknown): val is (...args: any[]) => any;
42
+ isBoolean(val: unknown): val is boolean;
43
+ isRegExp(val: unknown): val is RegExp;
44
+ isArray(val: any): val is Array<any>;
45
+ isEmpty<T = unknown>(val: T): val is T;
46
+ isPromise<T = any>(val: unknown): val is Promise<T>;
47
+ isPromiseLink<T>(it: T | PromiseLike<T>): it is PromiseLike<T>;
48
+ isWindow(val: any): val is Window;
49
+ isElement(val: unknown): val is Element;
50
+ isMap(val: unknown): val is Map<any, any>;
51
+ isServer(): boolean;
52
+ isClient(): boolean;
53
+ isUrl(path: string): boolean;
54
+ isIp(ip: string): boolean;
55
+ isEmail(v: any): boolean;
56
+ isValidPhoneNumber(phoneNumber: string): boolean;
57
+ isInMobileBrowser(): false | RegExpMatchArray | null;
58
+ isZhLang(lang: string): boolean;
59
+ isEdgeBrowser(): boolean;
60
+ isHtmlStr(str: string): boolean;
61
+ helper(val: Utils.BigNumValType): Utils.BigNumObj;
62
+ isBool(val: any): val is boolean;
63
+ isBigNum(val: any): val is Utils.BigNumObj;
64
+ isNum(val: any): val is number;
65
+ isNanValue(val: any): boolean;
66
+ isInt(val: any): boolean;
67
+ isGreaterThan(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
68
+ isLessThan(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
69
+ isEqualTo(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
70
+ isGreaterThanOrEqualTo(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
71
+ isLessThanOrEqualTo(num1: Utils.BigNumVal, num2: Utils.BigNumVal): boolean;
72
+ toBigNum(val: Utils.BigNumValType): BigNumber;
73
+ toNum(val: Utils.BigNumValType): number;
74
+ toInt(val: Utils.BigNumValType, isUp?: boolean): number;
75
+ toString(val: Utils.BigNumValType): string;
76
+ toDecimalPlaces(val: Utils.BigNumValType, decimal?: number, isUp?: boolean): number;
77
+ toLocaleString(val: Utils.BigNumValType): string;
78
+ add(...vals: Utils.BigNumValType[]): number;
79
+ subtract(...vals: Utils.BigNumValType[]): number;
80
+ multiply(...vals: Utils.BigNumValType[]): number;
81
+ divide(...vals: Utils.BigNumValType[]): number;
82
+ power(base: Utils.BigNumValType, exponent: Utils.BigNumValType): number;
83
+ formatRate(val: Utils.BigNumValType, unit?: string): string;
84
+ unFormatRate(val: Utils.BigNumValType): number;
85
+ DOWN: 1;
86
+ UP: 0;
87
+ BigNumber: BigNumber;
88
+ gt: typeof Utils.isGreaterThan;
89
+ gte: typeof Utils.isGreaterThanOrEqualTo;
90
+ lt: typeof Utils.isLessThan;
91
+ lte: typeof Utils.isLessThanOrEqualTo;
92
+ eq: typeof Utils.isEqualTo;
93
+ isNan: typeof Utils.isNanValue;
94
+ propTypes: __DTS_DEFAULT_0__;
95
+ timeZoneOptions: Utils.TimeZoneItem[];
96
+ withInstall<T>(component: T, alias?: string): T & Plugin;
97
+ useCopyToClipboard(initial?: string): {
98
+ clipboardRef: Ref<string, string>;
99
+ isSuccessRef: Ref<boolean, boolean>;
100
+ copiedRef: Ref<boolean, boolean>;
101
+ };
102
+ copyTextToClipboard(input: string, { target }?: {
103
+ target?: HTMLElement;
104
+ }): boolean;
105
+ useFormKeypressEnter<T extends (...args: any[]) => any, L extends WatchSource<boolean>>(fn: T, loading: L): (...args: any[]) => any;
106
+ useMemo<T>(getValue: () => T, condition: ( WatchSource<unknown> | object)[], shouldUpdate?: (prev: any[], next: any[]) => boolean): Ref<T, T>;
107
+ toGoogleAuth(clientId: string, redirectUri: string): void;
108
+ GoogleAuth: {
109
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<Partial< ExtractPropTypes<{
110
+ clientId: StringConstructor;
111
+ redirectUri: StringConstructor;
112
+ defaultLoad: BooleanConstructor;
113
+ getPopupContainer: {
114
+ type: PropType<() => HTMLElement | Element>;
115
+ };
116
+ onCallback: {
117
+ type: PropType<(data: {
118
+ code: string;
119
+ }) => void>;
120
+ };
121
+ onRejectCallback: {
122
+ type: PropType<(error: any) => void>;
123
+ };
124
+ }>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
125
+ P: {};
126
+ B: {};
127
+ D: {};
128
+ C: {};
129
+ M: {};
130
+ Defaults: {};
131
+ }, Readonly<Partial< ExtractPropTypes<{
132
+ clientId: StringConstructor;
133
+ redirectUri: StringConstructor;
134
+ defaultLoad: BooleanConstructor;
135
+ getPopupContainer: {
136
+ type: PropType<() => HTMLElement | Element>;
137
+ };
138
+ onCallback: {
139
+ type: PropType<(data: {
140
+ code: string;
141
+ }) => void>;
142
+ };
143
+ onRejectCallback: {
144
+ type: PropType<(error: any) => void>;
145
+ };
146
+ }>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
147
+ __isFragment?: never;
148
+ __isTeleport?: never;
149
+ __isSuspense?: never;
150
+ } & ComponentOptionsBase<Readonly<Partial< ExtractPropTypes<{
151
+ clientId: StringConstructor;
152
+ redirectUri: StringConstructor;
153
+ defaultLoad: BooleanConstructor;
154
+ getPopupContainer: {
155
+ type: PropType<() => HTMLElement | Element>;
156
+ };
157
+ onCallback: {
158
+ type: PropType<(data: {
159
+ code: string;
160
+ }) => void>;
161
+ };
162
+ onRejectCallback: {
163
+ type: PropType<(error: any) => void>;
164
+ };
165
+ }>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
166
+ readonly toGoogleAuth: typeof Comps.toGoogleAuth;
167
+ } & Plugin;
168
+ toTelegramAuth(botId: number, toPath: string): void;
169
+ getTelegramAuthUrlParams(): Comps.TgUserData | null;
170
+ TelegramAuth: {
171
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<Partial< ExtractPropTypes<{
172
+ botId: NumberConstructor;
173
+ toPath: StringConstructor;
174
+ defaultLoad: BooleanConstructor;
175
+ getPopupContainer: {
176
+ type: PropType<() => HTMLElement | Element>;
177
+ };
178
+ onCallback: {
179
+ type: PropType<(user: Comps.TgUserData) => void>;
180
+ };
181
+ onRejectCallback: {
182
+ type: PropType<() => void>;
183
+ };
184
+ }>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
185
+ P: {};
186
+ B: {};
187
+ D: {};
188
+ C: {};
189
+ M: {};
190
+ Defaults: {};
191
+ }, Readonly<Partial< ExtractPropTypes<{
192
+ botId: NumberConstructor;
193
+ toPath: StringConstructor;
194
+ defaultLoad: BooleanConstructor;
195
+ getPopupContainer: {
196
+ type: PropType<() => HTMLElement | Element>;
197
+ };
198
+ onCallback: {
199
+ type: PropType<(user: Comps.TgUserData) => void>;
200
+ };
201
+ onRejectCallback: {
202
+ type: PropType<() => void>;
203
+ };
204
+ }>>> & Readonly<{}>, {}, {}, {}, {}, {}>;
205
+ __isFragment?: never;
206
+ __isTeleport?: never;
207
+ __isSuspense?: never;
208
+ } & ComponentOptionsBase<Readonly<Partial< ExtractPropTypes<{
209
+ botId: NumberConstructor;
210
+ toPath: StringConstructor;
211
+ defaultLoad: BooleanConstructor;
212
+ getPopupContainer: {
213
+ type: PropType<() => HTMLElement | Element>;
214
+ };
215
+ onCallback: {
216
+ type: PropType<(user: Comps.TgUserData) => void>;
217
+ };
218
+ onRejectCallback: {
219
+ type: PropType<() => void>;
220
+ };
221
+ }>>> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
222
+ readonly toTelegramAuth: typeof Comps.toTelegramAuth;
223
+ readonly getTelegramAuthUrlParams: typeof Comps.getTelegramAuthUrlParams;
224
+ } & Plugin;
225
+ };
226
+ export default JKVUEComps;
@@ -0,0 +1,55 @@
1
+ import { VNode, RendererNode, RendererElement } from 'vue';
2
+ export * from './is';
3
+ export * from './math';
4
+ export * from './vuePropTypes';
5
+ export * from './timeZone';
6
+ export * from './withInstall';
7
+ /** 代替eval方法 */
8
+ export declare function evalPro(str: string): any;
9
+ /** 数字输入过滤
10
+ * @param eventVal 输入的值
11
+ * @param type 输入类型,int整数,float,default: 'int'
12
+ * @param maxDecimal 最大小数位,default: 6
13
+ */
14
+ export declare function filterInputNum(eventVal: string | number, type?: 'int' | 'float', maxDecimal?: number): string;
15
+ /** 生成输入数字过滤函数
16
+ * @param obj 对象
17
+ * @param key 对象里面的字段名
18
+ * @param fn 输入过滤之后执行的函数
19
+ * @param type 输入类型,int整数,float,default: 'int'
20
+ * @param maxDecimal 最大小数位,default: 6
21
+ */
22
+ 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;
23
+ /** 渲染Html字符串片段 */
24
+ export declare function renderHtmlStr(html: string): string | VNode<RendererNode, RendererElement, {
25
+ [key: string]: any;
26
+ }>;
27
+ /** 获取当前网站协议+域名 */
28
+ export declare function getWebsiteUrl(): string;
29
+ /** 获取路由参数 */
30
+ export declare function getRouterParams(): Recordable<any> | undefined;
31
+ /** 去除字符串里的所有空字符 */
32
+ export declare function removeWhitespace(str: any): string;
33
+ /** 深度合并 */
34
+ export declare function deepMerge<T = any>(src?: any, target?: any): T;
35
+ /** 字符串脱敏
36
+ * @param str 值
37
+ * @param number 可见的字符数,default: 6
38
+ * @param options = {
39
+ * showPrefix 显示前缀字符,default: true
40
+ * showSuffix 显示后缀字符,default: true
41
+ * middleStr 中间的字符串,default: '****'
42
+ * }
43
+ */
44
+ export declare function desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
45
+ showPrefix?: boolean;
46
+ showSuffix?: boolean;
47
+ middleStr?: string;
48
+ }): string | undefined;
49
+ /** 数字转为样式单位
50
+ * @param str 值
51
+ * @param unit 单位,default: 'px'
52
+ */
53
+ export declare function toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
54
+ /** 数字转为样式对象 */
55
+ export declare function toStyleObject(style?: string | Recordable | null): Recordable<any>;
@@ -0,0 +1,59 @@
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 (...args: any[]) => any;
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 function isServer(): boolean;
42
+ /** 是否客户端,window对象不为undefined */
43
+ export declare function isClient(): boolean;
44
+ /** 是否url */
45
+ export declare function isUrl(path: string): boolean;
46
+ /** 是否Ip */
47
+ export declare function isIp(ip: string): boolean;
48
+ /** 是否邮箱 */
49
+ export declare function isEmail(v: any): 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 function isHtmlStr(str: string): boolean;
@@ -0,0 +1,39 @@
1
+ /** 代替lodash.clone */
2
+ export declare function clone<T>(value: T): T;
3
+ /** 深拷贝 */
4
+ export declare function cloneDeep<T>(target: T, map?: WeakMap<object, any>): T;
5
+ /** 代替lodash.pick */
6
+ export declare function pick<T extends object, K extends keyof T>(obj: T | null | undefined, keys: K | K[]): Pick<T, K>;
7
+ /** 代替lodash.pickBy */
8
+ export declare function pickBy<T extends object, S extends T[keyof T]>(obj: T | null | undefined, predicate: (value: T[keyof T], key: keyof T) => value is S): {
9
+ [K in keyof T]?: S;
10
+ };
11
+ export declare function pickBy<T extends object>(obj: T | null | undefined, predicate: (value: T[keyof T], key: keyof T) => any): Partial<T>;
12
+ /** 代替lodash.omit */
13
+ export declare function omit<T extends object, K extends keyof T = keyof T>(obj: T, keys: K | K[]): Omit<T, K>;
14
+ export declare function omit<T extends object>(obj: T): T;
15
+ export declare function omit<T extends null | undefined>(obj: T, keys?: any): T;
16
+ export declare function omit<T extends string | number | boolean | symbol>(obj: T, keys?: any): T;
17
+ type GetPathValue<T, P extends string> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? GetPathValue<Exclude<T[Key], undefined | null>, Rest> : undefined : P extends keyof T ? T[P] : undefined;
18
+ /** 代替lodash.get */
19
+ export declare function get<T extends object, P extends string>(obj: T, path: P): GetPathValue<T, P>;
20
+ export declare function get<T extends object, P extends string, D>(obj: T, path: P, defaultValue: D): Exclude<GetPathValue<T, P>, undefined> | D;
21
+ /** 代替lodash.set */
22
+ export declare function set<T>(obj: T, path: string | number, value: any): T;
23
+ /** 代替lodash.isNil */
24
+ export declare function isNil(value: any): value is null | undefined;
25
+ /** 代替lodash.isEqual */
26
+ export declare function isEqual(value: any, other: any): boolean;
27
+ /** 代替lodash.uniq */
28
+ export declare function uniq<T>(array: T[] | null | undefined): T[];
29
+ /** 代替lodash.uniqBy */
30
+ export declare function uniqBy<T>(array: T[] | null | undefined, iteratee: ((item: T) => any) | keyof T): T[];
31
+ /** 代替lodash.upperFirst */
32
+ export declare function upperFirst(str: string | null | undefined): string;
33
+ /** 代替lodash.merge */
34
+ export declare function merge<T extends object, S extends object[]>(target: T, ...sources: S): T & any;
35
+ /** 代替lodash.difference */
36
+ export declare function difference<T>(array: T[] | null | undefined, ...values: T[][]): T[];
37
+ /** 代替lodash.intersection */
38
+ export declare function intersection<T>(...arrays: T[][]): T[];
39
+ export {};
@@ -0,0 +1,113 @@
1
+ import { default as BJS } from 'bignumber.js';
2
+ export type BigNumVal = BJS.Value;
3
+ export type BigNumValType = BigNumVal | undefined | null | boolean;
4
+ export type BigNumObj = BJS;
5
+ export declare const DOWN: 1;
6
+ export declare const UP: 0;
7
+ export declare const BigNumber: typeof BJS;
8
+ export declare function helper(val: BigNumValType): BigNumObj;
9
+ /** 是否为boolean值 */
10
+ export declare function isBool(val: any): val is boolean;
11
+ /** 是否为BigNumber对象 */
12
+ export declare function isBigNum(val: any): val is BigNumObj;
13
+ /** 是否为数字 */
14
+ export declare function isNum(val: any): val is number;
15
+ /** 是否为NaN值(传入任意值转bignumber是否为NaN) */
16
+ export declare function isNanValue(val: any): boolean;
17
+ /** 是否为整数(传入任意值转bignumber是否为整数) */
18
+ export declare function isInt(val: any): boolean;
19
+ /** 是否大于
20
+ * @example isGreaterThan('456', 132) => true
21
+ */
22
+ export declare function isGreaterThan(num1: BigNumVal, num2: BigNumVal): boolean;
23
+ /** 是否小于
24
+ * @example isLessThan('123', 132) => true
25
+ */
26
+ export declare function isLessThan(num1: BigNumVal, num2: BigNumVal): boolean;
27
+ /** 是否等于
28
+ * @example isEqualTo('123', 123) => true
29
+ */
30
+ export declare function isEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
31
+ /** 是否大于等于
32
+ * @example isGreaterThanOrEqualTo('1223', 123) => true
33
+ * @example isGreaterThanOrEqualTo('123', 123) => true
34
+ */
35
+ export declare function isGreaterThanOrEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
36
+ /** 是否小于等于
37
+ * @example isLessThanOrEqualTo('123', 123) => true
38
+ * @example isLessThanOrEqualTo('13', 123) => true
39
+ */
40
+ export declare function isLessThanOrEqualTo(num1: BigNumVal, num2: BigNumVal): boolean;
41
+ /** 转为BigNumber对象 */
42
+ export declare function toBigNum(val: BigNumValType): BJS;
43
+ /** 转为数字 */
44
+ export declare function toNum(val: BigNumValType): number;
45
+ /**
46
+ * 转为整数
47
+ * @example toInt(15.99) => 15
48
+ * @example toInt(-22.22) => -22
49
+ */
50
+ export declare function toInt(val: BigNumValType, isUp?: boolean): number;
51
+ /** 转为字符串 */
52
+ export declare function toString(val: BigNumValType): string;
53
+ /**
54
+ * 保留小数位(超过指定位数截断,小于位数不进行0补充)
55
+ * @param val val
56
+ * @param decimal 保留小数位数
57
+ * @param isUp 是否向上舍入 default: false
58
+ * @example toDecimalPlaces(2.326, 2) => 2.32
59
+ * @example toDecimalPlaces(-5.526, 2) => -5.52
60
+ * @example toDecimalPlaces(2.326, 2, true) => 2.33
61
+ * @example toDecimalPlaces(-5.526, 2, true) => -5.53
62
+ */
63
+ export declare function toDecimalPlaces(val: BigNumValType, decimal?: number, isUp?: boolean): number;
64
+ /** 转为千位符数字 */
65
+ export declare function toLocaleString(val: BigNumValType): string;
66
+ /**
67
+ * 相加
68
+ * @example add(3, 3) => 6
69
+ * @example add(3, 3, 4) => 10
70
+ */
71
+ export declare function add(...vals: BigNumValType[]): number;
72
+ /**
73
+ * 相减
74
+ * @example subtract('5', 3) => 2
75
+ * @example subtract(5, 3, '2') => 0
76
+ */
77
+ export declare function subtract(...vals: BigNumValType[]): number;
78
+ /**
79
+ * 相乘
80
+ * @example multiply('3', 5) => 15
81
+ * @example multiply(3, 5, '2') => 30
82
+ */
83
+ export declare function multiply(...vals: BigNumValType[]): number;
84
+ /**
85
+ * 相除
86
+ * @example divide('9', 3) => 3
87
+ * @example divide('100', 2, 10) => 5
88
+ * @example divide('100', 0, 10) => 0
89
+ */
90
+ export declare function divide(...vals: BigNumValType[]): number;
91
+ /**
92
+ * 幂运算
93
+ * @example power('2', '3') => 8
94
+ * @example power('10', 2) => 100
95
+ * @example power('-2', 3) => -8
96
+ */
97
+ export declare function power(base: BigNumValType, exponent: BigNumValType): number;
98
+ /**
99
+ * 小数转为百分比
100
+ * @example 0.1111 => 11.11%
101
+ */
102
+ export declare function formatRate(val: BigNumValType, unit?: string): string;
103
+ /**
104
+ * 转为百分小数
105
+ * @example 22.22 => 0.2222
106
+ */
107
+ export declare function unFormatRate(val: BigNumValType): number;
108
+ export declare const gt: typeof isGreaterThan;
109
+ export declare const gte: typeof isGreaterThanOrEqualTo;
110
+ export declare const lt: typeof isLessThan;
111
+ export declare const lte: typeof isLessThanOrEqualTo;
112
+ export declare const eq: typeof isEqualTo;
113
+ export declare const isNan: typeof isNanValue;
@@ -0,0 +1,9 @@
1
+ /** 时区项类型 */
2
+ export type TimeZoneItem = {
3
+ label: string;
4
+ enLabel: string;
5
+ value: string;
6
+ tzNum: number;
7
+ };
8
+ /** 时区列表 */
9
+ export declare const timeZoneOptions: TimeZoneItem[];
@@ -0,0 +1,17 @@
1
+ import { CSSProperties, VNode, VNodeChild } from 'vue';
2
+ import { VueTypeValidableDef } from 'vue-types';
3
+ import * as VueTypes from 'vue-types';
4
+ declare const VuePropTypes_base: ReturnType<typeof VueTypes.createTypes>;
5
+ declare class VuePropTypes extends VuePropTypes_base {
6
+ static vueTypes: typeof VueTypes;
7
+ static anyType: typeof VueTypes.any;
8
+ static stringType: typeof VueTypes.string;
9
+ static boolType: typeof VueTypes.bool;
10
+ static numberType: typeof VueTypes.number;
11
+ static funcType: typeof VueTypes.func;
12
+ static get style(): VueTypeValidableDef<CSSProperties>;
13
+ static get vueNode(): VueTypeValidableDef<VNode | VNodeChild>;
14
+ }
15
+ /** vue-types类型工具 */
16
+ export declare const propTypes: typeof VuePropTypes;
17
+ export default VuePropTypes;
@@ -0,0 +1,3 @@
1
+ import { Plugin } from 'vue';
2
+ /** 组件得到install方法 */
3
+ export declare function withInstall<T>(component: T, alias?: string): T & Plugin;
@@ -1,55 +1 @@
1
- import { VNode, RendererNode, RendererElement } from 'vue';
2
- export * from './is';
3
- export * from './math';
4
- export * from './vuePropTypes';
5
- export * from './timeZone';
6
- export * from './withInstall';
7
- /** 代替eval方法 */
8
- export declare function evalPro(str: string): any;
9
- /** 数字输入过滤
10
- * @param eventVal 输入的值
11
- * @param type 输入类型,int整数,float,default: 'int'
12
- * @param maxDecimal 最大小数位,default: 6
13
- */
14
- export declare function filterInputNum(eventVal: string | number, type?: 'int' | 'float', maxDecimal?: number): string;
15
- /** 生成输入数字过滤函数
16
- * @param obj 对象
17
- * @param key 对象里面的字段名
18
- * @param fn 输入过滤之后执行的函数
19
- * @param type 输入类型,int整数,float,default: 'int'
20
- * @param maxDecimal 最大小数位,default: 6
21
- */
22
- 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;
23
- /** 渲染Html字符串片段 */
24
- export declare function renderHtmlStr(html: string): string | VNode<RendererNode, RendererElement, {
25
- [key: string]: any;
26
- }>;
27
- /** 获取当前网站协议+域名 */
28
- export declare function getWebsiteUrl(): string;
29
- /** 获取路由参数 */
30
- export declare function getRouterParams(): Recordable<any> | undefined;
31
- /** 去除字符串里的所有空字符 */
32
- export declare function removeWhitespace(str: any): string;
33
- /** 深度合并 */
34
- export declare function deepMerge<T = any>(src?: any, target?: any): T;
35
- /** 字符串脱敏
36
- * @param str 值
37
- * @param number 可见的字符数,default: 6
38
- * @param options = {
39
- * showPrefix 显示前缀字符,default: true
40
- * showSuffix 显示后缀字符,default: true
41
- * middleStr 中间的字符串,default: '****'
42
- * }
43
- */
44
- export declare function desensitization(str?: string | number, number?: number, { showPrefix, showSuffix, middleStr }?: {
45
- showPrefix?: boolean;
46
- showSuffix?: boolean;
47
- middleStr?: string;
48
- }): string | undefined;
49
- /** 数字转为样式单位
50
- * @param str 值
51
- * @param unit 单位,default: 'px'
52
- */
53
- export declare function toStyleUnit(str?: string | number | null, unit?: string): string | undefined;
54
- /** 数字转为样式对象 */
55
- export declare function toStyleObject(style?: string | Recordable | null): Recordable<any>;
1
+ export {}
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/chunk-cBPL4W67.js";
2
2
  import { is as t, isArray as n, isBoolean as r, isClient as i, isDate as a, isDef as o, isEdgeBrowser as s, isElement as c, isEmail as l, isEmpty as u, isFunction as d, isHtmlStr as f, isInMobileBrowser as p, isIp as ee, isMap as te, isNull as ne, isNullAndUnDef as m, isNullOrUnDef as h, isNumber as g, isObject as _, isPromise as v, isPromiseLink as y, isRegExp as b, isServer as x, isString as S, isUnDef as C, isUrl as w, isValidPhoneNumber as T, isWindow as E, isZhLang as D } from "./is.js";
3
- import { A as O, C as k, D as A, E as j, M, N, O as P, S as F, T as I, _ as L, a as R, b as z, c as B, d as V, f as H, g as U, h as W, i as G, j as K, k as q, l as J, m as Y, n as re, o as X, p as ie, r as ae, s as oe, t as se, u as ce, v as le, w as ue, x as de, y as fe } from "../chunks/math-BbxxKXFw.js";
3
+ import { A as O, C as k, D as A, E as j, M, N, O as P, S as F, T as I, _ as L, a as R, b as z, c as B, d as V, f as H, g as U, h as W, i as G, j as K, k as q, l as J, m as Y, n as re, o as X, p as ie, r as ae, s as oe, t as se, u as ce, v as le, w as ue, x as de, y as fe } from "../chunks/math-Dcn-34Qj.js";
4
4
  import { propTypes as pe } from "./vuePropTypes.js";
5
5
  import { timeZoneOptions as me } from "./timeZone.js";
6
6
  import { withInstall as he } from "./withInstall.js";
@@ -1,59 +1 @@
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 (...args: any[]) => any;
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 function isServer(): boolean;
42
- /** 是否客户端,window对象不为undefined */
43
- export declare function isClient(): boolean;
44
- /** 是否url */
45
- export declare function isUrl(path: string): boolean;
46
- /** 是否Ip */
47
- export declare function isIp(ip: string): boolean;
48
- /** 是否邮箱 */
49
- export declare function isEmail(v: any): 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 function isHtmlStr(str: string): boolean;
1
+ export {}