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
@@ -1,39 +1 @@
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 {};
1
+ export {}
@@ -1,113 +1 @@
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;
1
+ export {}
@@ -1,2 +1,2 @@
1
- import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../chunks/math-BbxxKXFw.js";
1
+ import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../chunks/math-Dcn-34Qj.js";
2
2
  export { D as BigNumber, S as DOWN, T as UP, _ as add, u as divide, C as eq, E as formatRate, f as gt, b as gte, O as helper, p as isBigNum, m as isBool, w as isEqualTo, x as isGreaterThan, g as isGreaterThanOrEqualTo, h as isInt, l as isLessThan, k as isLessThanOrEqualTo, M as isNan, d as isNanValue, j as isNum, s as lt, t as lte, A as multiply, c as power, r as subtract, n as toBigNum, o as toDecimalPlaces, y as toInt, e as toLocaleString, v as toNum, i as toString, a as unFormatRate };
@@ -1,9 +1 @@
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[];
1
+ export {}
@@ -1,17 +1 @@
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;
1
+ export {}
@@ -1,3 +1 @@
1
- import { Plugin } from 'vue';
2
- /** 组件得到install方法 */
3
- export declare function withInstall<T>(component: T, alias?: string): T & Plugin;
1
+ export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jk-vue-comps",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "jk-vue-comps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,17 +31,17 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "bignumber.js": "10.0.2",
34
- "vue": "3.5.30",
34
+ "vue": "3.5.32",
35
35
  "vue-types": "6.0.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "22.18.0",
39
39
  "@vitejs/plugin-vue": "6.0.5",
40
40
  "@vitejs/plugin-vue-jsx": "5.1.5",
41
- "oxfmt": "^0.41.0",
42
- "oxlint": "^1.56.0",
43
- "typescript": "5.9.3",
44
- "vite": "8.0.1",
41
+ "oxfmt": "^0.44.0",
42
+ "oxlint": "^1.59.0",
43
+ "typescript": "6.0.2",
44
+ "vite": "8.0.7",
45
45
  "vite-plugin-dts": "^4.5.4",
46
46
  "rimraf": "^6.1.3",
47
47
  "vue-tsc": "^3.2.6"