tttb 0.1.24

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 (235) hide show
  1. package/README.md +42 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  3. package/dist/components/Button/index.js +6 -0
  4. package/dist/components/Button/index.vue.js +7 -0
  5. package/dist/components/Button/index.vue2.js +57 -0
  6. package/dist/components/Button/types.js +8 -0
  7. package/dist/components/Checkbox/index.js +6 -0
  8. package/dist/components/Checkbox/index.vue.js +7 -0
  9. package/dist/components/Checkbox/index.vue2.js +35 -0
  10. package/dist/components/Checkbox/types.js +7 -0
  11. package/dist/components/Dialog/DialogItem.vue.js +7 -0
  12. package/dist/components/Dialog/DialogItem.vue2.js +78 -0
  13. package/dist/components/Dialog/DialogPrompt.vue.js +7 -0
  14. package/dist/components/Dialog/DialogPrompt.vue2.js +63 -0
  15. package/dist/components/Dialog/index.js +6 -0
  16. package/dist/components/Dialog/index.vue.js +7 -0
  17. package/dist/components/Dialog/index.vue2.js +81 -0
  18. package/dist/components/Icon/index.js +6 -0
  19. package/dist/components/Icon/index.vue.js +43 -0
  20. package/dist/components/Icon/index.vue2.js +4 -0
  21. package/dist/components/Loading/index.js +6 -0
  22. package/dist/components/Loading/index.vue.js +7 -0
  23. package/dist/components/Loading/index.vue2.js +37 -0
  24. package/dist/components/Loading/types.js +7 -0
  25. package/dist/components/Message/index.js +6 -0
  26. package/dist/components/Message/index.vue.js +7 -0
  27. package/dist/components/Message/index.vue2.js +91 -0
  28. package/dist/components/Modal/index.js +6 -0
  29. package/dist/components/Modal/index.vue.js +7 -0
  30. package/dist/components/Modal/index.vue2.js +39 -0
  31. package/dist/components/Modal/types.js +7 -0
  32. package/dist/components/Nav/index.js +6 -0
  33. package/dist/components/Nav/index.vue.js +7 -0
  34. package/dist/components/Nav/index.vue2.js +95 -0
  35. package/dist/components/Pagination/index.js +6 -0
  36. package/dist/components/Pagination/index.vue.js +7 -0
  37. package/dist/components/Pagination/index.vue2.js +162 -0
  38. package/dist/components/Pagination/types.js +8 -0
  39. package/dist/components/Popconfirm/index.js +7 -0
  40. package/dist/components/Popconfirm/index.vue.js +92 -0
  41. package/dist/components/Popconfirm/index.vue3.js +5 -0
  42. package/dist/components/Popconfirm/types.js +14 -0
  43. package/dist/components/Popover/index.js +7 -0
  44. package/dist/components/Popover/index.vue.js +32 -0
  45. package/dist/components/Popover/index.vue3.js +5 -0
  46. package/dist/components/Progress/index.js +6 -0
  47. package/dist/components/Progress/index.vue.js +7 -0
  48. package/dist/components/Progress/index.vue2.js +38 -0
  49. package/dist/components/Progress/types.js +7 -0
  50. package/dist/components/RouterNav/index.js +6 -0
  51. package/dist/components/RouterNav/index.vue.js +33 -0
  52. package/dist/components/RouterNav/index.vue2.js +4 -0
  53. package/dist/components/Switch/index.js +6 -0
  54. package/dist/components/Switch/index.vue.js +7 -0
  55. package/dist/components/Switch/index.vue2.js +76 -0
  56. package/dist/components/Switch/types.js +6 -0
  57. package/dist/components/Table/index.js +6 -0
  58. package/dist/components/Table/index.vue.js +7 -0
  59. package/dist/components/Table/index.vue2.js +57 -0
  60. package/dist/components/Timer/index.js +6 -0
  61. package/dist/components/Timer/index.vue.js +31 -0
  62. package/dist/components/Timer/index.vue2.js +4 -0
  63. package/dist/components/Tooltip/TooltipContent.vue.js +33 -0
  64. package/dist/components/Tooltip/TooltipContent.vue2.js +4 -0
  65. package/dist/components/Tooltip/TooltipItem.vue.js +58 -0
  66. package/dist/components/Tooltip/TooltipItem.vue2.js +4 -0
  67. package/dist/components/Tooltip/TooltipLayer.vue.js +49 -0
  68. package/dist/components/Tooltip/TooltipLayer.vue2.js +4 -0
  69. package/dist/components/Tooltip/index.js +6 -0
  70. package/dist/components/Tooltip/index.vue.js +74 -0
  71. package/dist/components/Tooltip/index.vue2.js +4 -0
  72. package/dist/components/Tooltip/manager.js +107 -0
  73. package/dist/components/Tooltip/types.js +21 -0
  74. package/dist/components/Tooltip/useTooltip.js +43 -0
  75. package/dist/components/Warn/index.js +6 -0
  76. package/dist/components/Warn/index.vue.js +7 -0
  77. package/dist/components/Warn/index.vue2.js +21 -0
  78. package/dist/components/Warn/types.js +6 -0
  79. package/dist/components/Watermark/index.js +6 -0
  80. package/dist/components/Watermark/index.vue.js +7 -0
  81. package/dist/components/Watermark/index.vue2.js +54 -0
  82. package/dist/components/Watermark/types.js +10 -0
  83. package/dist/components/Watermark/useWatermarkBg.js +11 -0
  84. package/dist/components/helpers.js +25 -0
  85. package/dist/components.js +40 -0
  86. package/dist/directives/vBackTop.js +110 -0
  87. package/dist/directives/vDelayIn.js +41 -0
  88. package/dist/directives/vHoldPointer.js +112 -0
  89. package/dist/directives/vLazy.js +65 -0
  90. package/dist/directives/vLoading.js +50 -0
  91. package/dist/directives/vRipple.js +81 -0
  92. package/dist/directives/vSlideIn.js +39 -0
  93. package/dist/directives/vTextJump.js +50 -0
  94. package/dist/directives/vTooltip.js +55 -0
  95. package/dist/directives.js +20 -0
  96. package/dist/hooks/useAudio.js +112 -0
  97. package/dist/hooks/useElementScroll.js +30 -0
  98. package/dist/hooks/useGSAP.js +40 -0
  99. package/dist/hooks/useRefreshRate.js +26 -0
  100. package/dist/hooks/useWindowBackTop.js +86 -0
  101. package/dist/hooks.js +13 -0
  102. package/dist/icons/brands.js +554 -0
  103. package/dist/icons/regular.js +278 -0
  104. package/dist/icons/solid.js +1989 -0
  105. package/dist/index.js +130 -0
  106. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +448 -0
  107. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +400 -0
  108. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  109. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
  110. package/dist/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +131 -0
  111. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +3074 -0
  112. package/dist/node_modules/@fortawesome/free-brands-svg-icons/index.js +3156 -0
  113. package/dist/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
  114. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +9602 -0
  115. package/dist/node_modules/@fortawesome/vue-fontawesome/index.es.js +487 -0
  116. package/dist/node_modules/gsap/CSSPlugin.js +424 -0
  117. package/dist/node_modules/gsap/gsap-core.js +1645 -0
  118. package/dist/node_modules/gsap/index.js +13 -0
  119. package/dist/tttb.css +1 -0
  120. package/dist/types/bundle.d.ts +10 -0
  121. package/dist/types/components/Button/index.d.ts +22 -0
  122. package/dist/types/components/Button/types.d.ts +12 -0
  123. package/dist/types/components/Checkbox/index.d.ts +29 -0
  124. package/dist/types/components/Checkbox/types.d.ts +8 -0
  125. package/dist/types/components/Dialog/DialogItem.d.ts +38 -0
  126. package/dist/types/components/Dialog/DialogPrompt.d.ts +16 -0
  127. package/dist/types/components/Dialog/index.d.ts +10 -0
  128. package/dist/types/components/Dialog/types.d.ts +35 -0
  129. package/dist/types/components/Icon/index.d.ts +3 -0
  130. package/dist/types/components/Icon/types.d.ts +2 -0
  131. package/dist/types/components/Loading/index.d.ts +6 -0
  132. package/dist/types/components/Loading/types.d.ts +8 -0
  133. package/dist/types/components/Message/index.d.ts +9 -0
  134. package/dist/types/components/Message/types.d.ts +12 -0
  135. package/dist/types/components/Modal/index.d.ts +21 -0
  136. package/dist/types/components/Modal/types.d.ts +11 -0
  137. package/dist/types/components/Nav/index.d.ts +7 -0
  138. package/dist/types/components/Nav/types.d.ts +14 -0
  139. package/dist/types/components/Pagination/index.d.ts +18 -0
  140. package/dist/types/components/Pagination/types.d.ts +16 -0
  141. package/dist/types/components/Popconfirm/index.d.ts +266 -0
  142. package/dist/types/components/Popconfirm/types.d.ts +26 -0
  143. package/dist/types/components/Popover/index.d.ts +150 -0
  144. package/dist/types/components/Progress/index.d.ts +21 -0
  145. package/dist/types/components/Progress/types.d.ts +9 -0
  146. package/dist/types/components/RouterNav/index.d.ts +2 -0
  147. package/dist/types/components/Switch/index.d.ts +13 -0
  148. package/dist/types/components/Switch/types.d.ts +6 -0
  149. package/dist/types/components/Table/index.d.ts +31 -0
  150. package/dist/types/components/Table/types.d.ts +3 -0
  151. package/dist/types/components/Timer/index.d.ts +6 -0
  152. package/dist/types/components/Tooltip/TooltipContent.d.ts +16 -0
  153. package/dist/types/components/Tooltip/TooltipItem.d.ts +45 -0
  154. package/dist/types/components/Tooltip/TooltipLayer.d.ts +2 -0
  155. package/dist/types/components/Tooltip/index.d.ts +42 -0
  156. package/dist/types/components/Tooltip/manager.d.ts +3384 -0
  157. package/dist/types/components/Tooltip/types.d.ts +52 -0
  158. package/dist/types/components/Tooltip/useTooltip.d.ts +8 -0
  159. package/dist/types/components/Warn/index.d.ts +20 -0
  160. package/dist/types/components/Warn/types.d.ts +6 -0
  161. package/dist/types/components/Watermark/index.d.ts +28 -0
  162. package/dist/types/components/Watermark/types.d.ts +14 -0
  163. package/dist/types/components/Watermark/useWatermarkBg.d.ts +6 -0
  164. package/dist/types/components/helpers.d.ts +14 -0
  165. package/dist/types/components/index.d.ts +19 -0
  166. package/dist/types/directives/helper.d.ts +4 -0
  167. package/dist/types/directives/index.d.ts +9 -0
  168. package/dist/types/directives/vBackTop.d.ts +3 -0
  169. package/dist/types/directives/vDelayIn.d.ts +3 -0
  170. package/dist/types/directives/vHoldPointer.d.ts +3 -0
  171. package/dist/types/directives/vLazy.d.ts +3 -0
  172. package/dist/types/directives/vLoading.d.ts +3 -0
  173. package/dist/types/directives/vRipple.d.ts +3 -0
  174. package/dist/types/directives/vSlideIn.d.ts +3 -0
  175. package/dist/types/directives/vTextJump.d.ts +3 -0
  176. package/dist/types/directives/vTooltip.d.ts +8 -0
  177. package/dist/types/hooks/index.d.ts +5 -0
  178. package/dist/types/hooks/useAudio.d.ts +38 -0
  179. package/dist/types/hooks/useElementScroll.d.ts +32 -0
  180. package/dist/types/hooks/useGSAP.d.ts +32 -0
  181. package/dist/types/hooks/useRefreshRate.d.ts +5 -0
  182. package/dist/types/hooks/useWindowBackTop.d.ts +14 -0
  183. package/dist/types/icons/brands.d.ts +551 -0
  184. package/dist/types/icons/regular.d.ts +275 -0
  185. package/dist/types/icons/solid.d.ts +1986 -0
  186. package/dist/types/router/index.d.ts +2 -0
  187. package/dist/types/utils/chance.d.ts +7 -0
  188. package/dist/types/utils/copyToClipboard.d.ts +6 -0
  189. package/dist/types/utils/debounce.d.ts +15 -0
  190. package/dist/types/utils/deepClone.d.ts +6 -0
  191. package/dist/types/utils/deepEqual.d.ts +5 -0
  192. package/dist/types/utils/dialog.d.ts +8 -0
  193. package/dist/types/utils/getId.d.ts +6 -0
  194. package/dist/types/utils/getRandomColor.d.ts +4 -0
  195. package/dist/types/utils/getRandomInt.d.ts +6 -0
  196. package/dist/types/utils/getRandomStr.d.ts +6 -0
  197. package/dist/types/utils/index.d.ts +23 -0
  198. package/dist/types/utils/injectStyles.d.ts +9 -0
  199. package/dist/types/utils/isElementOverflow.d.ts +20 -0
  200. package/dist/types/utils/isEmpty.d.ts +6 -0
  201. package/dist/types/utils/isMobile.d.ts +6 -0
  202. package/dist/types/utils/isObject.d.ts +4 -0
  203. package/dist/types/utils/isPromise.d.ts +6 -0
  204. package/dist/types/utils/localStorage.d.ts +24 -0
  205. package/dist/types/utils/msg.d.ts +8 -0
  206. package/dist/types/utils/omit.d.ts +6 -0
  207. package/dist/types/utils/pick.d.ts +6 -0
  208. package/dist/types/utils/sessionStorage.d.ts +24 -0
  209. package/dist/types/utils/shuffleArray.d.ts +6 -0
  210. package/dist/types/utils/throttle.d.ts +7 -0
  211. package/dist/utils/chance.js +7 -0
  212. package/dist/utils/copyToClipboard.js +21 -0
  213. package/dist/utils/debounce.js +14 -0
  214. package/dist/utils/deepClone.js +17 -0
  215. package/dist/utils/deepEqual.js +40 -0
  216. package/dist/utils/dialog.js +43 -0
  217. package/dist/utils/getId.js +10 -0
  218. package/dist/utils/getRandomColor.js +4 -0
  219. package/dist/utils/getRandomInt.js +4 -0
  220. package/dist/utils/getRandomStr.js +5 -0
  221. package/dist/utils/injectStyles.js +24 -0
  222. package/dist/utils/isElementOverflow.js +22 -0
  223. package/dist/utils/isEmpty.js +4 -0
  224. package/dist/utils/isMobile.js +7 -0
  225. package/dist/utils/isObject.js +4 -0
  226. package/dist/utils/isPromise.js +4 -0
  227. package/dist/utils/localStorage.js +47 -0
  228. package/dist/utils/msg.js +21 -0
  229. package/dist/utils/omit.js +9 -0
  230. package/dist/utils/pick.js +9 -0
  231. package/dist/utils/sessionStorage.js +47 -0
  232. package/dist/utils/shuffleArray.js +10 -0
  233. package/dist/utils/throttle.js +11 -0
  234. package/dist/utils.js +49 -0
  235. package/package.json +95 -0
@@ -0,0 +1,2 @@
1
+ declare const router: import('vue-router').Router;
2
+ export default router;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 概率函数
3
+ * @param num 0-100的数字
4
+ * @example
5
+ * chance(10); // 10%的概率返回true
6
+ */
7
+ export declare const chance: (num: number) => boolean;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 复制文本到剪贴板的通用方法
3
+ * @param text 需要复制的文本内容
4
+ * @returns Promise<string> - 成功时为原文本,失败时抛出错误
5
+ */
6
+ export declare function copyToClipboard(text: string): Promise<string>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 防抖函数接口定义,包含 cancel 方法
3
+ */
4
+ interface DebouncedFunc<T extends (...args: any[]) => any> {
5
+ (...args: Parameters<T>): void;
6
+ cancel: () => void;
7
+ }
8
+ /**
9
+ * 防抖函数
10
+ * 返回一个新函数,在规定时间内只执行最后一次调用,新函数具有 cancel 方法可以取消等待执行的函数
11
+ * @param func 目标函数
12
+ * @param duration 冷却时间(毫秒)
13
+ */
14
+ export declare const debounce: <T extends (...args: any[]) => any>(func: T, duration?: number) => DebouncedFunc<T>;
15
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 深拷贝函数,支持对象、数组、Symbol 键和循环引用
3
+ * @param obj 目标对象
4
+ * @param hash 用于解决循环引用的 WeakMap
5
+ */
6
+ export declare const deepClone: <T>(obj: T, hash?: WeakMap<object, any>) => T;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 深比较两个值是否相等
3
+ * 支持对象、数组、Date、RegExp、Map、Set、循环引用等
4
+ */
5
+ export declare const deepEqual: <T>(a: T, b: T) => boolean;
@@ -0,0 +1,8 @@
1
+ import { DialogOptions } from '../components/Dialog/types';
2
+ import { VNode } from 'vue';
3
+ export declare const dialog: {
4
+ destroy: () => void | undefined;
5
+ confirm: (options: DialogOptions | string | VNode) => Promise<any>;
6
+ alert: (options: DialogOptions | string | VNode) => Promise<any>;
7
+ prompt: (options: DialogOptions) => Promise<any>;
8
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 生成一个唯一ID
3
+ * @param n 生成的ID长度,应大于等于8,默认16
4
+ * @return ID字符串
5
+ */
6
+ export declare const getId: (n?: number) => string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @returns 形如#RRGGBB的随机颜色字符串
3
+ */
4
+ export declare const getRandomColor: () => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 获取随机整数,包括min 不包括max
3
+ * @param min 最小值
4
+ * @param max 最大值
5
+ */
6
+ export declare const getRandomInt: (min: number, max: number) => number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 生成一个随机字符串
3
+ * @param length 字符串长度
4
+ */
5
+ export declare const getRandomStr: (length?: number) => string;
6
+ export declare const getRandomString: (length?: number) => string;
@@ -0,0 +1,23 @@
1
+ export * from './chance';
2
+ export * from './copyToClipboard';
3
+ export * from './debounce';
4
+ export * from './deepClone';
5
+ export * from './deepEqual';
6
+ export * from './dialog';
7
+ export * from './getId';
8
+ export * from './getRandomColor';
9
+ export * from './getRandomInt';
10
+ export * from './getRandomStr';
11
+ export * from './injectStyles';
12
+ export * from './isElementOverflow';
13
+ export * from './isEmpty';
14
+ export * from './isMobile';
15
+ export * from './isObject';
16
+ export * from './isPromise';
17
+ export * from './localStorage';
18
+ export * from './msg';
19
+ export * from './omit';
20
+ export * from './pick';
21
+ export * from './sessionStorage';
22
+ export * from './shuffleArray';
23
+ export * from './throttle';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 动态注入全局样式,支持更新和移除
3
+ * @param css 样式字符串
4
+ * @param id 样式标识符,必须唯一,用于更新和移除
5
+ * @returns 一个控制器对象,包含 remove 方法用于移除该段样式
6
+ */
7
+ export declare const injectStyles: (css: string, id: string) => {
8
+ remove: () => void;
9
+ };
@@ -0,0 +1,20 @@
1
+ export interface IsElementOverflowOptions {
2
+ /** 检测方向
3
+ * @default 'both'
4
+ */
5
+ direction?: 'horizontal' | 'vertical' | 'both';
6
+ /** * 亚像素容差值,用于抹平高分屏下的渲染误差,默认为 1 (px)
7
+ * @default 1
8
+ */
9
+ tolerance?: number;
10
+ /** * (最优解) 内部包裹层元素。如果传入,将直接对比容器与内容的物理尺寸,100% 准确
11
+ */
12
+ innerElement?: HTMLElement | null;
13
+ /** * (终极兜底) 是否启用克隆节点检测。
14
+ * 当遇到 -webkit-line-clamp 多行截断且【没有】内部包裹层时,开启此项会克隆节点强制计算真实高度。
15
+ * 注意:会引发一次重绘(Reflow),请仅在必要时开启。
16
+ * @default false
17
+ */
18
+ useCloneCheck?: boolean;
19
+ }
20
+ export declare function isElementOverflow(element: HTMLElement | null, options?: IsElementOverflowOptions): boolean;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 判断是否为空
3
+ * @param value 需要判断的值
4
+ * @returns 是否为空
5
+ */
6
+ export declare const isEmpty: (value: any) => boolean;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 判断是否为移动端
3
+ * @example
4
+ * console.log(isMobile); // 输出: true 或 false,取决于当前设备是否为移动端
5
+ */
6
+ export declare const isMobile: boolean;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 判断是否为对象 (Type Guard)
3
+ */
4
+ export declare const isObject: (target: any) => target is Object;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 判断是否为Promise对象
3
+ * @param value 需要判断的值
4
+ * @returns {boolean} 是否为Promise对象
5
+ */
6
+ export declare const isPromise: <T = any>(value: any) => value is Promise<T>;
@@ -0,0 +1,24 @@
1
+ declare const localStorageUtil: {
2
+ /**
3
+ * 获取本地存储数据
4
+ * @param key 键名
5
+ * @returns 解析后的数据或 null
6
+ */
7
+ get<T = any>(key: string): T | null;
8
+ /**
9
+ * 设置本地存储数据
10
+ * @param key 键名
11
+ * @param value 值(会自动 JSON.stringify)
12
+ */
13
+ set<T = any>(key: string, value: T): void;
14
+ /**
15
+ * 移除指定键的数据
16
+ * @param key 键名
17
+ */
18
+ remove(key: string): void;
19
+ /**
20
+ * 清空所有本地存储
21
+ */
22
+ clear(): void;
23
+ };
24
+ export { localStorageUtil as localStorage };
@@ -0,0 +1,8 @@
1
+ export type MessageType = 'success' | 'error' | 'warning' | 'info' | 'primary';
2
+ export declare const msg: {
3
+ success: (content: string) => void;
4
+ error: (content: string) => void;
5
+ warning: (content: string) => void;
6
+ info: (content: string) => void;
7
+ primary: (content: string) => void;
8
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 创建一个新对象,省略指定键
3
+ * @param obj 原对象
4
+ * @param keys 需要省略的键数组
5
+ */
6
+ export declare const omit: <T extends object, K extends keyof T>(obj: T, keys: K[]) => Omit<T, K>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 创建一个新对象,只包含指定键
3
+ * @param obj 原对象
4
+ * @param keys 需要选取的键数组
5
+ */
6
+ export declare const pick: <T extends object, K extends keyof T>(obj: T, keys: K[]) => Pick<T, K>;
@@ -0,0 +1,24 @@
1
+ declare const sessionStorageUtil: {
2
+ /**
3
+ * 获取本地存储数据
4
+ * @param key 键名
5
+ * @returns 解析后的数据或 null
6
+ */
7
+ get<T = any>(key: string): T | null;
8
+ /**
9
+ * 设置本地存储数据
10
+ * @param key 键名
11
+ * @param value 值(会自动 JSON.stringify)
12
+ */
13
+ set<T = any>(key: string, value: T): void;
14
+ /**
15
+ * 移除指定键的数据
16
+ * @param key 键名
17
+ */
18
+ remove(key: string): void;
19
+ /**
20
+ * 清空所有本地存储
21
+ */
22
+ clear(): void;
23
+ };
24
+ export { sessionStorageUtil as sessionStorage };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 洗牌算法
3
+ * @param array 需要打乱的数组
4
+ * @returns 打乱后的数组,会改变原数组
5
+ */
6
+ export declare const shuffleArray: <T>(array: T[]) => T[];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 节流函数
3
+ * 返回一个新函数,在规定时间内只执行第一次调用
4
+ * @param func 目标函数
5
+ * @param wait 冷却时间(毫秒)
6
+ */
7
+ export declare const throttle: <T extends (...args: any[]) => any>(func: T, wait: number) => ((...args: Parameters<T>) => void);
@@ -0,0 +1,7 @@
1
+ const o = (t) => {
2
+ const n = t / 100;
3
+ return Math.random() < n;
4
+ };
5
+ export {
6
+ o as chance
7
+ };
@@ -0,0 +1,21 @@
1
+ async function a(e) {
2
+ if (typeof window > "u" || typeof document > "u")
3
+ throw new Error("copyToClipboard can only be used in a browser environment");
4
+ if (e = JSON.stringify(e), navigator?.clipboard?.writeText)
5
+ try {
6
+ return await navigator.clipboard.writeText(e), e;
7
+ } catch {
8
+ }
9
+ return r(e);
10
+ }
11
+ function r(e) {
12
+ const o = document.createElement("textarea");
13
+ o.value = e, o.style.display = "none", document.body.appendChild(o), o.focus(), o.select();
14
+ const n = document.execCommand("copy");
15
+ if (o.remove(), !n)
16
+ throw new Error("Fallback: Copy command was unsuccessful");
17
+ return e;
18
+ }
19
+ export {
20
+ a as copyToClipboard
21
+ };
@@ -0,0 +1,14 @@
1
+ const o = (c, i = 500) => {
2
+ let e;
3
+ const t = function(...n) {
4
+ e && clearTimeout(e), e = setTimeout(() => {
5
+ c.apply(this, n);
6
+ }, i);
7
+ };
8
+ return t.cancel = () => {
9
+ e && clearTimeout(e);
10
+ }, t;
11
+ };
12
+ export {
13
+ o as debounce
14
+ };
@@ -0,0 +1,17 @@
1
+ import { isObject as p } from "./isObject.js";
2
+ const i = (e, t = /* @__PURE__ */ new WeakMap()) => {
3
+ if (!p(e)) return e;
4
+ if (t.has(e)) return t.get(e);
5
+ const n = Array.isArray(e) ? [] : {};
6
+ t.set(e, n);
7
+ const c = Object.getOwnPropertySymbols(e);
8
+ c.length > 0 && c.forEach((r) => {
9
+ n[r] = i(e[r], t);
10
+ });
11
+ for (const r in e)
12
+ Object.prototype.hasOwnProperty.call(e, r) && (n[r] = i(e[r], t));
13
+ return n;
14
+ };
15
+ export {
16
+ i as deepClone
17
+ };
@@ -0,0 +1,40 @@
1
+ const i = (t, e) => {
2
+ if (t === e) return !0;
3
+ if (t == null || e == null) return t === e;
4
+ if (typeof t != typeof e) return !1;
5
+ if (t instanceof Date && e instanceof Date)
6
+ return t.getTime() === e.getTime();
7
+ if (t instanceof RegExp && e instanceof RegExp)
8
+ return t.source === e.source && t.flags === e.flags;
9
+ if (t instanceof Map && e instanceof Map) {
10
+ if (t.size !== e.size) return !1;
11
+ for (const [r, n] of t) {
12
+ const f = e.get(r);
13
+ if (!e.has(r) || !i(n, f))
14
+ return !1;
15
+ }
16
+ return !0;
17
+ }
18
+ if (t instanceof Set && e instanceof Set) {
19
+ if (t.size !== e.size) return !1;
20
+ const r = Array.from(t), n = Array.from(e);
21
+ return r.every((f) => n.some((s) => i(f, s)));
22
+ }
23
+ if (ArrayBuffer.isView(t) && ArrayBuffer.isView(e)) {
24
+ if (t.constructor !== e.constructor || t.byteLength !== e.byteLength) return !1;
25
+ const r = new Uint8Array(t.buffer, t.byteOffset, t.byteLength), n = new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
26
+ return r.every((f, s) => f === n[s]);
27
+ }
28
+ if (typeof t == "object" && typeof e == "object") {
29
+ const r = t, n = e, f = Object.keys(r), s = Object.keys(n);
30
+ if (f.length !== s.length) return !1;
31
+ for (const o of f)
32
+ if (!Object.prototype.hasOwnProperty.call(n, o) || !i(r[o], n[o]))
33
+ return !1;
34
+ return !0;
35
+ }
36
+ return Object.is(t, e);
37
+ };
38
+ export {
39
+ i as deepEqual
40
+ };
@@ -0,0 +1,43 @@
1
+ import c from "../components/Dialog/index.js";
2
+ import { h as s, render as l, isVNode as p } from "vue";
3
+ import { isObject as m } from "./isObject.js";
4
+ import "./localStorage.js";
5
+ import "./msg.js";
6
+ import "./sessionStorage.js";
7
+ let o = null, a = null;
8
+ const t = document.createElement("div");
9
+ t.id = "dialog-container";
10
+ const d = (r) => {
11
+ if (!Array.isArray(r.content))
12
+ throw new Error("Prompt content must be an array");
13
+ r.content = r.content.map((n) => {
14
+ if (typeof n == "string")
15
+ return { label: n };
16
+ if (m(n))
17
+ return n;
18
+ throw new Error("Prompt content must be an array of strings or objects");
19
+ });
20
+ }, f = (r, n) => {
21
+ if (Array.isArray(r))
22
+ throw new Error("Dialog params cannot be an array");
23
+ let e = {};
24
+ return !m(r) || p(r) ? e = { content: r } : e = { ...r }, n === "prompt" && d(e), { ...e, type: n };
25
+ }, u = () => {
26
+ o || (o = s(c, {
27
+ onDestroy: () => {
28
+ l(null, t), o = null, a = null, t.parentNode && t.parentNode.removeChild(t);
29
+ }
30
+ }), document.body.appendChild(t), l(o, t), a = o.component?.exposed);
31
+ }, i = (r, n) => {
32
+ u();
33
+ const e = f(r, n);
34
+ return a.open(e);
35
+ }, E = {
36
+ destroy: () => a?.destroyAll(),
37
+ confirm: (r) => i(r, "confirm"),
38
+ alert: (r) => i(r, "alert"),
39
+ prompt: (r) => i(r, "prompt")
40
+ };
41
+ export {
42
+ E as dialog
43
+ };
@@ -0,0 +1,10 @@
1
+ import { getRandomStr as o } from "./getRandomStr.js";
2
+ const n = (t = 16) => {
3
+ if (t < 8)
4
+ throw new Error("ID长度最小为8");
5
+ const r = Date.now().toString(36);
6
+ return r + o(t - r.length);
7
+ };
8
+ export {
9
+ n as getId
10
+ };
@@ -0,0 +1,4 @@
1
+ const o = () => Math.random().toString(16).slice(2, 8).padEnd(6, "0");
2
+ export {
3
+ o as getRandomColor
4
+ };
@@ -0,0 +1,4 @@
1
+ const a = (o, t) => Math.floor(Math.random() * (t - o)) + o;
2
+ export {
3
+ a as getRandomInt
4
+ };
@@ -0,0 +1,5 @@
1
+ const o = (t = 10) => t <= 11 ? Math.random().toString(36).slice(2, 2 + t).padEnd(t, "0") : o(11) + o(t - 11), r = o;
2
+ export {
3
+ o as getRandomStr,
4
+ r as getRandomString
5
+ };
@@ -0,0 +1,24 @@
1
+ const a = /* @__PURE__ */ (() => {
2
+ const l = typeof document < "u";
3
+ let e = null;
4
+ const r = /* @__PURE__ */ new Map(), u = () => l ? e || (e = document.createElement("style"), e.id = "v-global-styles", document.head.appendChild(e), e) : null, o = () => {
5
+ const n = u();
6
+ if (!n) return;
7
+ let t = "";
8
+ r.forEach((c, s) => {
9
+ t += `/* --- ${s} start --- */
10
+ ${c.trim()}
11
+ /* --- ${s} end --- */
12
+ `;
13
+ }), n.textContent = t;
14
+ };
15
+ return (n, t) => l ? (r.set(t, n), o(), {
16
+ remove: () => {
17
+ r.delete(t) && o();
18
+ }
19
+ }) : { remove: () => {
20
+ } };
21
+ })();
22
+ export {
23
+ a as injectStyles
24
+ };
@@ -0,0 +1,22 @@
1
+ function u(t, r = {}) {
2
+ if (!t) return !1;
3
+ const { direction: o = "both", tolerance: l = 1, innerElement: h, useCloneCheck: d = !1 } = r;
4
+ let n = !1, i = !1;
5
+ if (h) {
6
+ const s = t.getBoundingClientRect(), c = h.getBoundingClientRect();
7
+ return n = c.width - s.width > l, i = c.height - s.height > l, o === "both" ? n || i : o === "horizontal" ? n : i;
8
+ }
9
+ if (n = t.scrollWidth - t.clientWidth > l, i = t.scrollHeight - t.clientHeight > l, !i && d && o !== "horizontal") {
10
+ const s = window.getComputedStyle(t);
11
+ if (s.webkitLineClamp && s.webkitLineClamp !== "none") {
12
+ const e = t.cloneNode(!0);
13
+ e.style.webkitLineClamp = "unset", e.style.maxHeight = "none", e.style.height = "auto", e.style.position = "absolute", e.style.visibility = "hidden", e.style.width = `${t.clientWidth}px`, e.style.pointerEvents = "none", document.body.appendChild(e);
14
+ const a = e.getBoundingClientRect().height, g = t.getBoundingClientRect().height;
15
+ i = a - g > l, document.body.removeChild(e);
16
+ }
17
+ }
18
+ return o === "both" ? n || i : o === "horizontal" ? n : i;
19
+ }
20
+ export {
21
+ u as isElementOverflow
22
+ };
@@ -0,0 +1,4 @@
1
+ const r = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 : t instanceof Map || t instanceof Set ? t.size === 0 : typeof t == "object" ? Object.keys(t).length === 0 : !1;
2
+ export {
3
+ r as isEmpty
4
+ };
@@ -0,0 +1,7 @@
1
+ const i = (() => {
2
+ const e = navigator.userAgent || navigator.vendor || window.opera;
3
+ return /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);
4
+ })();
5
+ export {
6
+ i as isMobile
7
+ };
@@ -0,0 +1,4 @@
1
+ const o = (e) => typeof e == "object" && e !== null;
2
+ export {
3
+ o as isObject
4
+ };
@@ -0,0 +1,4 @@
1
+ const o = (t) => !!t && (typeof t == "object" || typeof t == "function") && typeof t.then == "function" && typeof t.catch == "function";
2
+ export {
3
+ o as isPromise
4
+ };
@@ -0,0 +1,47 @@
1
+ import { msg as l } from "./msg.js";
2
+ const e = window.localStorage;
3
+ e || l.error("当前浏览器不支持localStorage存储功能,部分功能可能无法使用,请更换浏览器后重试");
4
+ const c = {
5
+ /**
6
+ * 获取本地存储数据
7
+ * @param key 键名
8
+ * @returns 解析后的数据或 null
9
+ */
10
+ get(r) {
11
+ const t = e.getItem(r);
12
+ if (!t) return null;
13
+ try {
14
+ return JSON.parse(t);
15
+ } catch (o) {
16
+ return console.error(`Error parsing localStorage key "${r}":`, o), null;
17
+ }
18
+ },
19
+ /**
20
+ * 设置本地存储数据
21
+ * @param key 键名
22
+ * @param value 值(会自动 JSON.stringify)
23
+ */
24
+ set(r, t) {
25
+ try {
26
+ e.setItem(r, JSON.stringify(t));
27
+ } catch {
28
+ l.error("本地数据存储失败,请清除缓存后重试");
29
+ }
30
+ },
31
+ /**
32
+ * 移除指定键的数据
33
+ * @param key 键名
34
+ */
35
+ remove(r) {
36
+ e.removeItem(r);
37
+ },
38
+ /**
39
+ * 清空所有本地存储
40
+ */
41
+ clear() {
42
+ e.clear();
43
+ }
44
+ };
45
+ export {
46
+ c as localStorage
47
+ };
@@ -0,0 +1,21 @@
1
+ import { createVNode as a, render as s } from "vue";
2
+ import m from "../components/Message/index.js";
3
+ let o = null, t = null;
4
+ const n = document.createElement("div");
5
+ n.id = "message-container";
6
+ const r = (e, i) => {
7
+ o || (o = a(m, {
8
+ onDestroy: () => {
9
+ s(null, n), o = null, t = null, n.parentNode && n.parentNode.removeChild(n);
10
+ }
11
+ }), document.getElementById("message-container") || document.body.appendChild(n), s(o, n), t = o.component?.exposed), t?.add(e, i);
12
+ }, l = {
13
+ success: (e) => r(e, "success"),
14
+ error: (e) => r(e, "error"),
15
+ warning: (e) => r(e, "warning"),
16
+ info: (e) => r(e, "info"),
17
+ primary: (e) => r(e, "primary")
18
+ };
19
+ export {
20
+ l as msg
21
+ };
@@ -0,0 +1,9 @@
1
+ const o = (e, n) => {
2
+ const r = {};
3
+ for (const t in e)
4
+ Object.prototype.hasOwnProperty.call(e, t) && !n.includes(t) && (r[t] = e[t]);
5
+ return r;
6
+ };
7
+ export {
8
+ o as omit
9
+ };
@@ -0,0 +1,9 @@
1
+ const c = (o, e) => {
2
+ const r = {};
3
+ for (const t of e)
4
+ Object.prototype.hasOwnProperty.call(o, t) && (r[t] = o[t]);
5
+ return r;
6
+ };
7
+ export {
8
+ c as pick
9
+ };