@alibarbar/common 1.0.0

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 (210) hide show
  1. package/README.md +338 -0
  2. package/dist/algorithm.d.mts +66 -0
  3. package/dist/algorithm.d.ts +66 -0
  4. package/dist/algorithm.js +44 -0
  5. package/dist/algorithm.js.map +1 -0
  6. package/dist/algorithm.mjs +3 -0
  7. package/dist/algorithm.mjs.map +1 -0
  8. package/dist/array.d.mts +139 -0
  9. package/dist/array.d.ts +139 -0
  10. package/dist/array.js +84 -0
  11. package/dist/array.js.map +1 -0
  12. package/dist/array.mjs +3 -0
  13. package/dist/array.mjs.map +1 -0
  14. package/dist/chunk-27UDDVLZ.js +259 -0
  15. package/dist/chunk-27UDDVLZ.js.map +1 -0
  16. package/dist/chunk-2FFSQ573.mjs +138 -0
  17. package/dist/chunk-2FFSQ573.mjs.map +1 -0
  18. package/dist/chunk-4RGXV4SJ.js +106 -0
  19. package/dist/chunk-4RGXV4SJ.js.map +1 -0
  20. package/dist/chunk-56W6YECK.js +374 -0
  21. package/dist/chunk-56W6YECK.js.map +1 -0
  22. package/dist/chunk-5BGSUGTI.mjs +128 -0
  23. package/dist/chunk-5BGSUGTI.mjs.map +1 -0
  24. package/dist/chunk-7E6GELHJ.mjs +302 -0
  25. package/dist/chunk-7E6GELHJ.mjs.map +1 -0
  26. package/dist/chunk-7V5UQXIO.js +89 -0
  27. package/dist/chunk-7V5UQXIO.js.map +1 -0
  28. package/dist/chunk-A4SWQXX7.mjs +484 -0
  29. package/dist/chunk-A4SWQXX7.mjs.map +1 -0
  30. package/dist/chunk-ALDC6LRJ.mjs +85 -0
  31. package/dist/chunk-ALDC6LRJ.mjs.map +1 -0
  32. package/dist/chunk-BHCRFURU.js +491 -0
  33. package/dist/chunk-BHCRFURU.js.map +1 -0
  34. package/dist/chunk-D7CS5EKF.js +110 -0
  35. package/dist/chunk-D7CS5EKF.js.map +1 -0
  36. package/dist/chunk-DYBSRI7V.js +189 -0
  37. package/dist/chunk-DYBSRI7V.js.map +1 -0
  38. package/dist/chunk-F3LAGHPG.js +332 -0
  39. package/dist/chunk-F3LAGHPG.js.map +1 -0
  40. package/dist/chunk-HLDFI7R2.mjs +175 -0
  41. package/dist/chunk-HLDFI7R2.mjs.map +1 -0
  42. package/dist/chunk-HME2N3VY.mjs +354 -0
  43. package/dist/chunk-HME2N3VY.mjs.map +1 -0
  44. package/dist/chunk-I3L42475.js +145 -0
  45. package/dist/chunk-I3L42475.js.map +1 -0
  46. package/dist/chunk-JBLX27WD.mjs +240 -0
  47. package/dist/chunk-JBLX27WD.mjs.map +1 -0
  48. package/dist/chunk-JHZ7M2MR.mjs +133 -0
  49. package/dist/chunk-JHZ7M2MR.mjs.map +1 -0
  50. package/dist/chunk-JK2SE3I2.js +100 -0
  51. package/dist/chunk-JK2SE3I2.js.map +1 -0
  52. package/dist/chunk-JQZBPAPO.js +157 -0
  53. package/dist/chunk-JQZBPAPO.js.map +1 -0
  54. package/dist/chunk-JXYGC2C5.mjs +100 -0
  55. package/dist/chunk-JXYGC2C5.mjs.map +1 -0
  56. package/dist/chunk-KGFTD255.js +104 -0
  57. package/dist/chunk-KGFTD255.js.map +1 -0
  58. package/dist/chunk-LBHBNPNJ.mjs +148 -0
  59. package/dist/chunk-LBHBNPNJ.mjs.map +1 -0
  60. package/dist/chunk-LCXGZISK.js +158 -0
  61. package/dist/chunk-LCXGZISK.js.map +1 -0
  62. package/dist/chunk-LF4CILQS.mjs +87 -0
  63. package/dist/chunk-LF4CILQS.mjs.map +1 -0
  64. package/dist/chunk-MMR6XQNX.js +98 -0
  65. package/dist/chunk-MMR6XQNX.js.map +1 -0
  66. package/dist/chunk-NSSDYX2U.mjs +80 -0
  67. package/dist/chunk-NSSDYX2U.mjs.map +1 -0
  68. package/dist/chunk-O3O67R4I.js +143 -0
  69. package/dist/chunk-O3O67R4I.js.map +1 -0
  70. package/dist/chunk-OX5PLOWB.js +90 -0
  71. package/dist/chunk-OX5PLOWB.js.map +1 -0
  72. package/dist/chunk-PJ7UCTX4.mjs +362 -0
  73. package/dist/chunk-PJ7UCTX4.mjs.map +1 -0
  74. package/dist/chunk-QIBE7GVN.mjs +81 -0
  75. package/dist/chunk-QIBE7GVN.mjs.map +1 -0
  76. package/dist/chunk-QIOC54LQ.mjs +130 -0
  77. package/dist/chunk-QIOC54LQ.mjs.map +1 -0
  78. package/dist/chunk-QV6MIQ7H.mjs +328 -0
  79. package/dist/chunk-QV6MIQ7H.mjs.map +1 -0
  80. package/dist/chunk-TQN37HIN.js +94 -0
  81. package/dist/chunk-TQN37HIN.js.map +1 -0
  82. package/dist/chunk-XJTZDXSR.mjs +94 -0
  83. package/dist/chunk-XJTZDXSR.mjs.map +1 -0
  84. package/dist/chunk-XVUE53T3.js +361 -0
  85. package/dist/chunk-XVUE53T3.js.map +1 -0
  86. package/dist/chunk-Y364QIQH.js +139 -0
  87. package/dist/chunk-Y364QIQH.js.map +1 -0
  88. package/dist/chunk-YXM6Q4JS.mjs +94 -0
  89. package/dist/chunk-YXM6Q4JS.mjs.map +1 -0
  90. package/dist/chunk-ZDMFMUDR.js +309 -0
  91. package/dist/chunk-ZDMFMUDR.js.map +1 -0
  92. package/dist/chunk-ZVJ6NQUM.mjs +82 -0
  93. package/dist/chunk-ZVJ6NQUM.mjs.map +1 -0
  94. package/dist/color.d.mts +74 -0
  95. package/dist/color.d.ts +74 -0
  96. package/dist/color.js +40 -0
  97. package/dist/color.js.map +1 -0
  98. package/dist/color.mjs +3 -0
  99. package/dist/color.mjs.map +1 -0
  100. package/dist/crypto.d.mts +92 -0
  101. package/dist/crypto.d.ts +92 -0
  102. package/dist/crypto.js +60 -0
  103. package/dist/crypto.js.map +1 -0
  104. package/dist/crypto.mjs +3 -0
  105. package/dist/crypto.mjs.map +1 -0
  106. package/dist/data-structure.d.mts +213 -0
  107. package/dist/data-structure.d.ts +213 -0
  108. package/dist/data-structure.js +32 -0
  109. package/dist/data-structure.js.map +1 -0
  110. package/dist/data-structure.mjs +3 -0
  111. package/dist/data-structure.mjs.map +1 -0
  112. package/dist/date.d.mts +108 -0
  113. package/dist/date.d.ts +108 -0
  114. package/dist/date.js +72 -0
  115. package/dist/date.js.map +1 -0
  116. package/dist/date.mjs +3 -0
  117. package/dist/date.mjs.map +1 -0
  118. package/dist/dom.d.mts +92 -0
  119. package/dist/dom.d.ts +92 -0
  120. package/dist/dom.js +56 -0
  121. package/dist/dom.js.map +1 -0
  122. package/dist/dom.mjs +3 -0
  123. package/dist/dom.mjs.map +1 -0
  124. package/dist/file.d.mts +44 -0
  125. package/dist/file.d.ts +44 -0
  126. package/dist/file.js +32 -0
  127. package/dist/file.js.map +1 -0
  128. package/dist/file.mjs +3 -0
  129. package/dist/file.mjs.map +1 -0
  130. package/dist/i18n.d.mts +77 -0
  131. package/dist/i18n.d.ts +77 -0
  132. package/dist/i18n.js +40 -0
  133. package/dist/i18n.js.map +1 -0
  134. package/dist/i18n.mjs +3 -0
  135. package/dist/i18n.mjs.map +1 -0
  136. package/dist/index.d.mts +155 -0
  137. package/dist/index.d.ts +155 -0
  138. package/dist/index.js +839 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/index.mjs +22 -0
  141. package/dist/index.mjs.map +1 -0
  142. package/dist/network.d.mts +47 -0
  143. package/dist/network.d.ts +47 -0
  144. package/dist/network.js +28 -0
  145. package/dist/network.js.map +1 -0
  146. package/dist/network.mjs +3 -0
  147. package/dist/network.mjs.map +1 -0
  148. package/dist/number.d.mts +100 -0
  149. package/dist/number.d.ts +100 -0
  150. package/dist/number.js +56 -0
  151. package/dist/number.js.map +1 -0
  152. package/dist/number.mjs +3 -0
  153. package/dist/number.mjs.map +1 -0
  154. package/dist/object.d.mts +132 -0
  155. package/dist/object.d.ts +132 -0
  156. package/dist/object.js +80 -0
  157. package/dist/object.js.map +1 -0
  158. package/dist/object.mjs +3 -0
  159. package/dist/object.mjs.map +1 -0
  160. package/dist/performance.d.mts +85 -0
  161. package/dist/performance.d.ts +85 -0
  162. package/dist/performance.js +40 -0
  163. package/dist/performance.js.map +1 -0
  164. package/dist/performance.mjs +3 -0
  165. package/dist/performance.mjs.map +1 -0
  166. package/dist/storage.d.mts +176 -0
  167. package/dist/storage.d.ts +176 -0
  168. package/dist/storage.js +33 -0
  169. package/dist/storage.js.map +1 -0
  170. package/dist/storage.mjs +4 -0
  171. package/dist/storage.mjs.map +1 -0
  172. package/dist/string.d.mts +105 -0
  173. package/dist/string.d.ts +105 -0
  174. package/dist/string.js +68 -0
  175. package/dist/string.js.map +1 -0
  176. package/dist/string.mjs +3 -0
  177. package/dist/string.mjs.map +1 -0
  178. package/dist/tracking.d.mts +182 -0
  179. package/dist/tracking.d.ts +182 -0
  180. package/dist/tracking.js +52 -0
  181. package/dist/tracking.js.map +1 -0
  182. package/dist/tracking.mjs +3 -0
  183. package/dist/tracking.mjs.map +1 -0
  184. package/dist/transform.d.mts +53 -0
  185. package/dist/transform.d.ts +53 -0
  186. package/dist/transform.js +32 -0
  187. package/dist/transform.js.map +1 -0
  188. package/dist/transform.mjs +3 -0
  189. package/dist/transform.mjs.map +1 -0
  190. package/dist/upload-DzlQtUBc.d.mts +202 -0
  191. package/dist/upload-DzlQtUBc.d.ts +202 -0
  192. package/dist/upload.d.mts +1 -0
  193. package/dist/upload.d.ts +1 -0
  194. package/dist/upload.js +17 -0
  195. package/dist/upload.js.map +1 -0
  196. package/dist/upload.mjs +4 -0
  197. package/dist/upload.mjs.map +1 -0
  198. package/dist/url.d.mts +82 -0
  199. package/dist/url.d.ts +82 -0
  200. package/dist/url.js +44 -0
  201. package/dist/url.js.map +1 -0
  202. package/dist/url.mjs +3 -0
  203. package/dist/url.mjs.map +1 -0
  204. package/dist/validation.d.mts +83 -0
  205. package/dist/validation.d.ts +83 -0
  206. package/dist/validation.js +60 -0
  207. package/dist/validation.js.map +1 -0
  208. package/dist/validation.mjs +3 -0
  209. package/dist/validation.mjs.map +1 -0
  210. package/package.json +170 -0
package/dist/date.js ADDED
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ var chunkI3L42475_js = require('./chunk-I3L42475.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "addDays", {
8
+ enumerable: true,
9
+ get: function () { return chunkI3L42475_js.addDays; }
10
+ });
11
+ Object.defineProperty(exports, "addMonths", {
12
+ enumerable: true,
13
+ get: function () { return chunkI3L42475_js.addMonths; }
14
+ });
15
+ Object.defineProperty(exports, "addYears", {
16
+ enumerable: true,
17
+ get: function () { return chunkI3L42475_js.addYears; }
18
+ });
19
+ Object.defineProperty(exports, "diffDays", {
20
+ enumerable: true,
21
+ get: function () { return chunkI3L42475_js.diffDays; }
22
+ });
23
+ Object.defineProperty(exports, "endOfDay", {
24
+ enumerable: true,
25
+ get: function () { return chunkI3L42475_js.endOfDay; }
26
+ });
27
+ Object.defineProperty(exports, "formatDate", {
28
+ enumerable: true,
29
+ get: function () { return chunkI3L42475_js.formatDate; }
30
+ });
31
+ Object.defineProperty(exports, "getDateFormatByGMT", {
32
+ enumerable: true,
33
+ get: function () { return chunkI3L42475_js.getDateFormatByGMT; }
34
+ });
35
+ Object.defineProperty(exports, "getQuarter", {
36
+ enumerable: true,
37
+ get: function () { return chunkI3L42475_js.getQuarter; }
38
+ });
39
+ Object.defineProperty(exports, "getRelativeTime", {
40
+ enumerable: true,
41
+ get: function () { return chunkI3L42475_js.getRelativeTime; }
42
+ });
43
+ Object.defineProperty(exports, "getTimeFromGMT", {
44
+ enumerable: true,
45
+ get: function () { return chunkI3L42475_js.getTimeFromGMT; }
46
+ });
47
+ Object.defineProperty(exports, "getWeekNumber", {
48
+ enumerable: true,
49
+ get: function () { return chunkI3L42475_js.getWeekNumber; }
50
+ });
51
+ Object.defineProperty(exports, "isToday", {
52
+ enumerable: true,
53
+ get: function () { return chunkI3L42475_js.isToday; }
54
+ });
55
+ Object.defineProperty(exports, "isWeekday", {
56
+ enumerable: true,
57
+ get: function () { return chunkI3L42475_js.isWeekday; }
58
+ });
59
+ Object.defineProperty(exports, "isWeekend", {
60
+ enumerable: true,
61
+ get: function () { return chunkI3L42475_js.isWeekend; }
62
+ });
63
+ Object.defineProperty(exports, "isYesterday", {
64
+ enumerable: true,
65
+ get: function () { return chunkI3L42475_js.isYesterday; }
66
+ });
67
+ Object.defineProperty(exports, "startOfDay", {
68
+ enumerable: true,
69
+ get: function () { return chunkI3L42475_js.startOfDay; }
70
+ });
71
+ //# sourceMappingURL=date.js.map
72
+ //# sourceMappingURL=date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"date.js"}
package/dist/date.mjs ADDED
@@ -0,0 +1,3 @@
1
+ export { addDays, addMonths, addYears, diffDays, endOfDay, formatDate, getDateFormatByGMT, getQuarter, getRelativeTime, getTimeFromGMT, getWeekNumber, isToday, isWeekday, isWeekend, isYesterday, startOfDay } from './chunk-5BGSUGTI.mjs';
2
+ //# sourceMappingURL=date.mjs.map
3
+ //# sourceMappingURL=date.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"date.mjs"}
package/dist/dom.d.mts ADDED
@@ -0,0 +1,92 @@
1
+ /**
2
+ * DOM工具函数
3
+ */
4
+ /**
5
+ * 选择器封装
6
+ * @param selector - CSS选择器
7
+ * @param context - 上下文元素,默认为 document
8
+ * @returns 匹配的元素或元素数组
9
+ */
10
+ declare function $<T extends Element = Element>(selector: string, context?: Document | Element): T | null;
11
+ /**
12
+ * 选择器封装(返回所有匹配元素)
13
+ * @param selector - CSS选择器
14
+ * @param context - 上下文元素,默认为 document
15
+ * @returns 匹配的元素数组
16
+ */
17
+ declare function $$<T extends Element = Element>(selector: string, context?: Document | Element): T[];
18
+ /**
19
+ * 添加类名
20
+ * @param element - DOM元素
21
+ * @param className - 类名
22
+ */
23
+ declare function addClass(element: Element, className: string): void;
24
+ /**
25
+ * 移除类名
26
+ * @param element - DOM元素
27
+ * @param className - 类名
28
+ */
29
+ declare function removeClass(element: Element, className: string): void;
30
+ /**
31
+ * 切换类名
32
+ * @param element - DOM元素
33
+ * @param className - 类名
34
+ * @returns 是否包含该类名
35
+ */
36
+ declare function toggleClass(element: Element, className: string): boolean;
37
+ /**
38
+ * 获取样式
39
+ * @param element - DOM元素
40
+ * @param property - CSS属性名
41
+ * @returns 样式值
42
+ */
43
+ declare function getStyle(element: HTMLElement, property: string): string;
44
+ /**
45
+ * 设置样式
46
+ * @param element - DOM元素
47
+ * @param property - CSS属性名或样式对象
48
+ * @param value - 样式值(当property为字符串时)
49
+ */
50
+ declare function setStyle(element: HTMLElement, property: string | Record<string, string>, value?: string): void;
51
+ /**
52
+ * 平滑滚动
53
+ * @param target - 目标位置(元素、选择器或数字)
54
+ * @param options - 滚动选项
55
+ */
56
+ declare function scrollTo(target: Element | string | number, options?: {
57
+ behavior?: ScrollBehavior;
58
+ block?: ScrollLogicalPosition;
59
+ inline?: ScrollLogicalPosition;
60
+ }): void;
61
+ /**
62
+ * 获取滚动位置
63
+ * @returns 滚动位置对象
64
+ */
65
+ declare function getScrollPosition(): {
66
+ x: number;
67
+ y: number;
68
+ };
69
+ /**
70
+ * 判断元素是否在视口内
71
+ * @param element - DOM元素
72
+ * @param threshold - 阈值(0-1),默认为 0
73
+ * @returns 是否在视口内
74
+ */
75
+ declare function isInViewport(element: Element, threshold?: number): boolean;
76
+ /**
77
+ * 获取元素偏移量
78
+ * @param element - DOM元素
79
+ * @returns 偏移量对象
80
+ */
81
+ declare function getElementOffset(element: Element): {
82
+ top: number;
83
+ left: number;
84
+ };
85
+ /**
86
+ * 复制到剪贴板
87
+ * @param text - 要复制的文本
88
+ * @returns Promise<void>
89
+ */
90
+ declare function copyToClipboard(text: string): Promise<void>;
91
+
92
+ export { $, $$, addClass, copyToClipboard, getElementOffset, getScrollPosition, getStyle, isInViewport, removeClass, scrollTo, setStyle, toggleClass };
package/dist/dom.d.ts ADDED
@@ -0,0 +1,92 @@
1
+ /**
2
+ * DOM工具函数
3
+ */
4
+ /**
5
+ * 选择器封装
6
+ * @param selector - CSS选择器
7
+ * @param context - 上下文元素,默认为 document
8
+ * @returns 匹配的元素或元素数组
9
+ */
10
+ declare function $<T extends Element = Element>(selector: string, context?: Document | Element): T | null;
11
+ /**
12
+ * 选择器封装(返回所有匹配元素)
13
+ * @param selector - CSS选择器
14
+ * @param context - 上下文元素,默认为 document
15
+ * @returns 匹配的元素数组
16
+ */
17
+ declare function $$<T extends Element = Element>(selector: string, context?: Document | Element): T[];
18
+ /**
19
+ * 添加类名
20
+ * @param element - DOM元素
21
+ * @param className - 类名
22
+ */
23
+ declare function addClass(element: Element, className: string): void;
24
+ /**
25
+ * 移除类名
26
+ * @param element - DOM元素
27
+ * @param className - 类名
28
+ */
29
+ declare function removeClass(element: Element, className: string): void;
30
+ /**
31
+ * 切换类名
32
+ * @param element - DOM元素
33
+ * @param className - 类名
34
+ * @returns 是否包含该类名
35
+ */
36
+ declare function toggleClass(element: Element, className: string): boolean;
37
+ /**
38
+ * 获取样式
39
+ * @param element - DOM元素
40
+ * @param property - CSS属性名
41
+ * @returns 样式值
42
+ */
43
+ declare function getStyle(element: HTMLElement, property: string): string;
44
+ /**
45
+ * 设置样式
46
+ * @param element - DOM元素
47
+ * @param property - CSS属性名或样式对象
48
+ * @param value - 样式值(当property为字符串时)
49
+ */
50
+ declare function setStyle(element: HTMLElement, property: string | Record<string, string>, value?: string): void;
51
+ /**
52
+ * 平滑滚动
53
+ * @param target - 目标位置(元素、选择器或数字)
54
+ * @param options - 滚动选项
55
+ */
56
+ declare function scrollTo(target: Element | string | number, options?: {
57
+ behavior?: ScrollBehavior;
58
+ block?: ScrollLogicalPosition;
59
+ inline?: ScrollLogicalPosition;
60
+ }): void;
61
+ /**
62
+ * 获取滚动位置
63
+ * @returns 滚动位置对象
64
+ */
65
+ declare function getScrollPosition(): {
66
+ x: number;
67
+ y: number;
68
+ };
69
+ /**
70
+ * 判断元素是否在视口内
71
+ * @param element - DOM元素
72
+ * @param threshold - 阈值(0-1),默认为 0
73
+ * @returns 是否在视口内
74
+ */
75
+ declare function isInViewport(element: Element, threshold?: number): boolean;
76
+ /**
77
+ * 获取元素偏移量
78
+ * @param element - DOM元素
79
+ * @returns 偏移量对象
80
+ */
81
+ declare function getElementOffset(element: Element): {
82
+ top: number;
83
+ left: number;
84
+ };
85
+ /**
86
+ * 复制到剪贴板
87
+ * @param text - 要复制的文本
88
+ * @returns Promise<void>
89
+ */
90
+ declare function copyToClipboard(text: string): Promise<void>;
91
+
92
+ export { $, $$, addClass, copyToClipboard, getElementOffset, getScrollPosition, getStyle, isInViewport, removeClass, scrollTo, setStyle, toggleClass };
package/dist/dom.js ADDED
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ var chunkJK2SE3I2_js = require('./chunk-JK2SE3I2.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "$", {
8
+ enumerable: true,
9
+ get: function () { return chunkJK2SE3I2_js.$; }
10
+ });
11
+ Object.defineProperty(exports, "$$", {
12
+ enumerable: true,
13
+ get: function () { return chunkJK2SE3I2_js.$$; }
14
+ });
15
+ Object.defineProperty(exports, "addClass", {
16
+ enumerable: true,
17
+ get: function () { return chunkJK2SE3I2_js.addClass; }
18
+ });
19
+ Object.defineProperty(exports, "copyToClipboard", {
20
+ enumerable: true,
21
+ get: function () { return chunkJK2SE3I2_js.copyToClipboard; }
22
+ });
23
+ Object.defineProperty(exports, "getElementOffset", {
24
+ enumerable: true,
25
+ get: function () { return chunkJK2SE3I2_js.getElementOffset; }
26
+ });
27
+ Object.defineProperty(exports, "getScrollPosition", {
28
+ enumerable: true,
29
+ get: function () { return chunkJK2SE3I2_js.getScrollPosition; }
30
+ });
31
+ Object.defineProperty(exports, "getStyle", {
32
+ enumerable: true,
33
+ get: function () { return chunkJK2SE3I2_js.getStyle; }
34
+ });
35
+ Object.defineProperty(exports, "isInViewport", {
36
+ enumerable: true,
37
+ get: function () { return chunkJK2SE3I2_js.isInViewport; }
38
+ });
39
+ Object.defineProperty(exports, "removeClass", {
40
+ enumerable: true,
41
+ get: function () { return chunkJK2SE3I2_js.removeClass; }
42
+ });
43
+ Object.defineProperty(exports, "scrollTo", {
44
+ enumerable: true,
45
+ get: function () { return chunkJK2SE3I2_js.scrollTo; }
46
+ });
47
+ Object.defineProperty(exports, "setStyle", {
48
+ enumerable: true,
49
+ get: function () { return chunkJK2SE3I2_js.setStyle; }
50
+ });
51
+ Object.defineProperty(exports, "toggleClass", {
52
+ enumerable: true,
53
+ get: function () { return chunkJK2SE3I2_js.toggleClass; }
54
+ });
55
+ //# sourceMappingURL=dom.js.map
56
+ //# sourceMappingURL=dom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"dom.js"}
package/dist/dom.mjs ADDED
@@ -0,0 +1,3 @@
1
+ export { $, $$, addClass, copyToClipboard, getElementOffset, getScrollPosition, getStyle, isInViewport, removeClass, scrollTo, setStyle, toggleClass } from './chunk-LF4CILQS.mjs';
2
+ //# sourceMappingURL=dom.mjs.map
3
+ //# sourceMappingURL=dom.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"dom.mjs"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 文件工具函数
3
+ */
4
+ /**
5
+ * 计算文件的MD5值(使用浏览器原生API)
6
+ * 注意:这里使用SHA-256作为简化实现,实际项目中建议使用spark-md5库计算真正的MD5
7
+ * @param file - 文件对象
8
+ * @returns Promise<string> 哈希值
9
+ */
10
+ declare function calculateFileMD5(file: File): Promise<string>;
11
+ /**
12
+ * 计算Blob的MD5值
13
+ * 注意:这里使用SHA-256作为简化实现,实际项目中建议使用spark-md5库计算真正的MD5
14
+ * @param blob - Blob对象
15
+ * @returns Promise<string> 哈希值
16
+ */
17
+ declare function calculateBlobMD5(blob: Blob): Promise<string>;
18
+ /**
19
+ * 将文件分割为多个分片
20
+ * @param file - 文件对象
21
+ * @param chunkSize - 分片大小(字节)
22
+ * @returns 分片数组
23
+ */
24
+ declare function splitFileIntoChunks(file: File, chunkSize: number): Blob[];
25
+ /**
26
+ * 格式化文件大小
27
+ * @param bytes - 字节数
28
+ * @returns 格式化后的文件大小字符串
29
+ */
30
+ declare function formatFileSize(bytes: number): string;
31
+ /**
32
+ * 获取文件扩展名
33
+ * @param fileName - 文件名
34
+ * @returns 扩展名(不含点)
35
+ */
36
+ declare function getFileExtension(fileName: string): string;
37
+ /**
38
+ * 获取文件名(不含扩展名)
39
+ * @param fileName - 文件名
40
+ * @returns 文件名(不含扩展名)
41
+ */
42
+ declare function getFileNameWithoutExtension(fileName: string): string;
43
+
44
+ export { calculateBlobMD5, calculateFileMD5, formatFileSize, getFileExtension, getFileNameWithoutExtension, splitFileIntoChunks };
package/dist/file.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 文件工具函数
3
+ */
4
+ /**
5
+ * 计算文件的MD5值(使用浏览器原生API)
6
+ * 注意:这里使用SHA-256作为简化实现,实际项目中建议使用spark-md5库计算真正的MD5
7
+ * @param file - 文件对象
8
+ * @returns Promise<string> 哈希值
9
+ */
10
+ declare function calculateFileMD5(file: File): Promise<string>;
11
+ /**
12
+ * 计算Blob的MD5值
13
+ * 注意:这里使用SHA-256作为简化实现,实际项目中建议使用spark-md5库计算真正的MD5
14
+ * @param blob - Blob对象
15
+ * @returns Promise<string> 哈希值
16
+ */
17
+ declare function calculateBlobMD5(blob: Blob): Promise<string>;
18
+ /**
19
+ * 将文件分割为多个分片
20
+ * @param file - 文件对象
21
+ * @param chunkSize - 分片大小(字节)
22
+ * @returns 分片数组
23
+ */
24
+ declare function splitFileIntoChunks(file: File, chunkSize: number): Blob[];
25
+ /**
26
+ * 格式化文件大小
27
+ * @param bytes - 字节数
28
+ * @returns 格式化后的文件大小字符串
29
+ */
30
+ declare function formatFileSize(bytes: number): string;
31
+ /**
32
+ * 获取文件扩展名
33
+ * @param fileName - 文件名
34
+ * @returns 扩展名(不含点)
35
+ */
36
+ declare function getFileExtension(fileName: string): string;
37
+ /**
38
+ * 获取文件名(不含扩展名)
39
+ * @param fileName - 文件名
40
+ * @returns 文件名(不含扩展名)
41
+ */
42
+ declare function getFileNameWithoutExtension(fileName: string): string;
43
+
44
+ export { calculateBlobMD5, calculateFileMD5, formatFileSize, getFileExtension, getFileNameWithoutExtension, splitFileIntoChunks };
package/dist/file.js ADDED
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ var chunk7V5UQXIO_js = require('./chunk-7V5UQXIO.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "calculateBlobMD5", {
8
+ enumerable: true,
9
+ get: function () { return chunk7V5UQXIO_js.calculateBlobMD5; }
10
+ });
11
+ Object.defineProperty(exports, "calculateFileMD5", {
12
+ enumerable: true,
13
+ get: function () { return chunk7V5UQXIO_js.calculateFileMD5; }
14
+ });
15
+ Object.defineProperty(exports, "formatFileSize", {
16
+ enumerable: true,
17
+ get: function () { return chunk7V5UQXIO_js.formatFileSize; }
18
+ });
19
+ Object.defineProperty(exports, "getFileExtension", {
20
+ enumerable: true,
21
+ get: function () { return chunk7V5UQXIO_js.getFileExtension; }
22
+ });
23
+ Object.defineProperty(exports, "getFileNameWithoutExtension", {
24
+ enumerable: true,
25
+ get: function () { return chunk7V5UQXIO_js.getFileNameWithoutExtension; }
26
+ });
27
+ Object.defineProperty(exports, "splitFileIntoChunks", {
28
+ enumerable: true,
29
+ get: function () { return chunk7V5UQXIO_js.splitFileIntoChunks; }
30
+ });
31
+ //# sourceMappingURL=file.js.map
32
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"file.js"}
package/dist/file.mjs ADDED
@@ -0,0 +1,3 @@
1
+ export { calculateBlobMD5, calculateFileMD5, formatFileSize, getFileExtension, getFileNameWithoutExtension, splitFileIntoChunks } from './chunk-ZVJ6NQUM.mjs';
2
+ //# sourceMappingURL=file.mjs.map
3
+ //# sourceMappingURL=file.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"file.mjs"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * 国际化工具函数
3
+ */
4
+ /**
5
+ * 语言环境类型
6
+ */
7
+ type Locale = string;
8
+ /**
9
+ * 货币代码类型(ISO 4217)
10
+ */
11
+ type CurrencyCode = string;
12
+ /**
13
+ * 获取当前语言环境
14
+ * @returns 语言环境字符串(如 'zh-CN', 'en-US')
15
+ */
16
+ declare function getLocale(): Locale;
17
+ /**
18
+ * 数字本地化格式化
19
+ * @param value - 数字值
20
+ * @param locale - 语言环境,默认为当前环境
21
+ * @param options - Intl.NumberFormat选项
22
+ * @returns 格式化后的字符串
23
+ */
24
+ declare function formatNumberI18n(value: number, locale?: Locale, options?: Intl.NumberFormatOptions): string;
25
+ /**
26
+ * 日期本地化格式化
27
+ * @param date - 日期对象或时间戳
28
+ * @param locale - 语言环境,默认为当前环境
29
+ * @param options - Intl.DateTimeFormat选项
30
+ * @returns 格式化后的字符串
31
+ */
32
+ declare function formatDateI18n(date: Date | number, locale?: Locale, options?: Intl.DateTimeFormatOptions): string;
33
+ /**
34
+ * 货币本地化格式化
35
+ * @param value - 金额
36
+ * @param currency - 货币代码(ISO 4217),如 'USD', 'CNY', 'EUR'
37
+ * @param locale - 语言环境,默认为当前环境
38
+ * @param options - Intl.NumberFormat选项
39
+ * @returns 格式化后的货币字符串
40
+ */
41
+ declare function formatCurrencyI18n(value: number, currency: CurrencyCode, locale?: Locale, options?: Intl.NumberFormatOptions): string;
42
+ /**
43
+ * 翻译字典类型
44
+ */
45
+ type TranslationDictionary = Record<string, string | Record<string, unknown>>;
46
+ /**
47
+ * 翻译函数
48
+ * @param key - 翻译键(支持点号分隔的嵌套键,如 'user.name')
49
+ * @param dictionary - 翻译字典
50
+ * @param defaultValue - 默认值(如果找不到翻译)
51
+ * @returns 翻译后的字符串
52
+ */
53
+ declare function translate(key: string, dictionary: TranslationDictionary, defaultValue?: string): string;
54
+ /**
55
+ * 创建翻译函数(带预设字典)
56
+ * @param dictionary - 翻译字典
57
+ * @returns 翻译函数
58
+ */
59
+ declare function createTranslator(dictionary: TranslationDictionary): (key: string, defaultValue?: string) => string;
60
+ /**
61
+ * 获取相对时间格式化(本地化)
62
+ * @param date - 日期对象或时间戳
63
+ * @param locale - 语言环境,默认为当前环境
64
+ * @returns 格式化后的相对时间字符串
65
+ */
66
+ declare function formatRelativeTime(date: Date | number, locale?: Locale): string;
67
+ /**
68
+ * 获取复数形式(简单实现)
69
+ * @param count - 数量
70
+ * @param singular - 单数形式
71
+ * @param plural - 复数形式(可选,默认为 singular + 's')
72
+ * @param locale - 语言环境,默认为当前环境
73
+ * @returns 格式化后的字符串
74
+ */
75
+ declare function pluralize(count: number, singular: string, plural?: string, locale?: Locale): string;
76
+
77
+ export { type CurrencyCode, type Locale, type TranslationDictionary, createTranslator, formatCurrencyI18n, formatDateI18n, formatNumberI18n, formatRelativeTime, getLocale, pluralize, translate };
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,77 @@
1
+ /**
2
+ * 国际化工具函数
3
+ */
4
+ /**
5
+ * 语言环境类型
6
+ */
7
+ type Locale = string;
8
+ /**
9
+ * 货币代码类型(ISO 4217)
10
+ */
11
+ type CurrencyCode = string;
12
+ /**
13
+ * 获取当前语言环境
14
+ * @returns 语言环境字符串(如 'zh-CN', 'en-US')
15
+ */
16
+ declare function getLocale(): Locale;
17
+ /**
18
+ * 数字本地化格式化
19
+ * @param value - 数字值
20
+ * @param locale - 语言环境,默认为当前环境
21
+ * @param options - Intl.NumberFormat选项
22
+ * @returns 格式化后的字符串
23
+ */
24
+ declare function formatNumberI18n(value: number, locale?: Locale, options?: Intl.NumberFormatOptions): string;
25
+ /**
26
+ * 日期本地化格式化
27
+ * @param date - 日期对象或时间戳
28
+ * @param locale - 语言环境,默认为当前环境
29
+ * @param options - Intl.DateTimeFormat选项
30
+ * @returns 格式化后的字符串
31
+ */
32
+ declare function formatDateI18n(date: Date | number, locale?: Locale, options?: Intl.DateTimeFormatOptions): string;
33
+ /**
34
+ * 货币本地化格式化
35
+ * @param value - 金额
36
+ * @param currency - 货币代码(ISO 4217),如 'USD', 'CNY', 'EUR'
37
+ * @param locale - 语言环境,默认为当前环境
38
+ * @param options - Intl.NumberFormat选项
39
+ * @returns 格式化后的货币字符串
40
+ */
41
+ declare function formatCurrencyI18n(value: number, currency: CurrencyCode, locale?: Locale, options?: Intl.NumberFormatOptions): string;
42
+ /**
43
+ * 翻译字典类型
44
+ */
45
+ type TranslationDictionary = Record<string, string | Record<string, unknown>>;
46
+ /**
47
+ * 翻译函数
48
+ * @param key - 翻译键(支持点号分隔的嵌套键,如 'user.name')
49
+ * @param dictionary - 翻译字典
50
+ * @param defaultValue - 默认值(如果找不到翻译)
51
+ * @returns 翻译后的字符串
52
+ */
53
+ declare function translate(key: string, dictionary: TranslationDictionary, defaultValue?: string): string;
54
+ /**
55
+ * 创建翻译函数(带预设字典)
56
+ * @param dictionary - 翻译字典
57
+ * @returns 翻译函数
58
+ */
59
+ declare function createTranslator(dictionary: TranslationDictionary): (key: string, defaultValue?: string) => string;
60
+ /**
61
+ * 获取相对时间格式化(本地化)
62
+ * @param date - 日期对象或时间戳
63
+ * @param locale - 语言环境,默认为当前环境
64
+ * @returns 格式化后的相对时间字符串
65
+ */
66
+ declare function formatRelativeTime(date: Date | number, locale?: Locale): string;
67
+ /**
68
+ * 获取复数形式(简单实现)
69
+ * @param count - 数量
70
+ * @param singular - 单数形式
71
+ * @param plural - 复数形式(可选,默认为 singular + 's')
72
+ * @param locale - 语言环境,默认为当前环境
73
+ * @returns 格式化后的字符串
74
+ */
75
+ declare function pluralize(count: number, singular: string, plural?: string, locale?: Locale): string;
76
+
77
+ export { type CurrencyCode, type Locale, type TranslationDictionary, createTranslator, formatCurrencyI18n, formatDateI18n, formatNumberI18n, formatRelativeTime, getLocale, pluralize, translate };
package/dist/i18n.js ADDED
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var chunkOX5PLOWB_js = require('./chunk-OX5PLOWB.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "createTranslator", {
8
+ enumerable: true,
9
+ get: function () { return chunkOX5PLOWB_js.createTranslator; }
10
+ });
11
+ Object.defineProperty(exports, "formatCurrencyI18n", {
12
+ enumerable: true,
13
+ get: function () { return chunkOX5PLOWB_js.formatCurrencyI18n; }
14
+ });
15
+ Object.defineProperty(exports, "formatDateI18n", {
16
+ enumerable: true,
17
+ get: function () { return chunkOX5PLOWB_js.formatDateI18n; }
18
+ });
19
+ Object.defineProperty(exports, "formatNumberI18n", {
20
+ enumerable: true,
21
+ get: function () { return chunkOX5PLOWB_js.formatNumberI18n; }
22
+ });
23
+ Object.defineProperty(exports, "formatRelativeTime", {
24
+ enumerable: true,
25
+ get: function () { return chunkOX5PLOWB_js.formatRelativeTime; }
26
+ });
27
+ Object.defineProperty(exports, "getLocale", {
28
+ enumerable: true,
29
+ get: function () { return chunkOX5PLOWB_js.getLocale; }
30
+ });
31
+ Object.defineProperty(exports, "pluralize", {
32
+ enumerable: true,
33
+ get: function () { return chunkOX5PLOWB_js.pluralize; }
34
+ });
35
+ Object.defineProperty(exports, "translate", {
36
+ enumerable: true,
37
+ get: function () { return chunkOX5PLOWB_js.translate; }
38
+ });
39
+ //# sourceMappingURL=i18n.js.map
40
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"i18n.js"}
package/dist/i18n.mjs ADDED
@@ -0,0 +1,3 @@
1
+ export { createTranslator, formatCurrencyI18n, formatDateI18n, formatNumberI18n, formatRelativeTime, getLocale, pluralize, translate } from './chunk-QIBE7GVN.mjs';
2
+ //# sourceMappingURL=i18n.mjs.map
3
+ //# sourceMappingURL=i18n.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"i18n.mjs"}