tttb 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/Button/index.js +6 -0
- package/dist/components/Button/index.vue.js +7 -0
- package/dist/components/Button/index.vue2.js +54 -0
- package/dist/components/Button/types.js +8 -0
- package/dist/components/Checkbox/index.js +6 -0
- package/dist/components/Checkbox/index.vue.js +7 -0
- package/dist/components/Checkbox/index.vue2.js +35 -0
- package/dist/components/Checkbox/types.js +7 -0
- package/dist/components/Collapse/index.js +6 -0
- package/dist/components/Collapse/index.vue.js +7 -0
- package/dist/components/Collapse/index.vue2.js +42 -0
- package/dist/components/Collapse/types.js +7 -0
- package/dist/components/CollapseItem/index.js +6 -0
- package/dist/components/CollapseItem/index.vue.js +7 -0
- package/dist/components/CollapseItem/index.vue2.js +80 -0
- package/dist/components/Dialog/DialogItem.vue.js +7 -0
- package/dist/components/Dialog/DialogItem.vue2.js +69 -0
- package/dist/components/Dialog/DialogPrompt.vue.js +7 -0
- package/dist/components/Dialog/DialogPrompt.vue2.js +63 -0
- package/dist/components/Dialog/index.js +6 -0
- package/dist/components/Dialog/index.vue.js +7 -0
- package/dist/components/Dialog/index.vue2.js +91 -0
- package/dist/components/Icon/index.js +6 -0
- package/dist/components/Icon/index.vue.js +45 -0
- package/dist/components/Icon/index.vue2.js +4 -0
- package/dist/components/Loading/index.js +6 -0
- package/dist/components/Loading/index.vue.js +7 -0
- package/dist/components/Loading/index.vue2.js +37 -0
- package/dist/components/Loading/types.js +7 -0
- package/dist/components/Message/index.js +6 -0
- package/dist/components/Message/index.vue.js +7 -0
- package/dist/components/Message/index.vue2.js +91 -0
- package/dist/components/Modal/index.js +6 -0
- package/dist/components/Modal/index.vue.js +7 -0
- package/dist/components/Modal/index.vue2.js +39 -0
- package/dist/components/Modal/types.js +7 -0
- package/dist/components/Nav/index.js +6 -0
- package/dist/components/Nav/index.vue.js +7 -0
- package/dist/components/Nav/index.vue2.js +95 -0
- package/dist/components/Pagination/index.js +6 -0
- package/dist/components/Pagination/index.vue.js +7 -0
- package/dist/components/Pagination/index.vue2.js +149 -0
- package/dist/components/Pagination/types.js +8 -0
- package/dist/components/Popconfirm/index.js +7 -0
- package/dist/components/Popconfirm/index.vue.js +92 -0
- package/dist/components/Popconfirm/index.vue3.js +5 -0
- package/dist/components/Popconfirm/types.js +14 -0
- package/dist/components/Popover/index.js +7 -0
- package/dist/components/Popover/index.vue.js +32 -0
- package/dist/components/Popover/index.vue3.js +5 -0
- package/dist/components/Progress/index.js +6 -0
- package/dist/components/Progress/index.vue.js +7 -0
- package/dist/components/Progress/index.vue2.js +38 -0
- package/dist/components/Progress/types.js +7 -0
- package/dist/components/RouterNav/index.js +6 -0
- package/dist/components/RouterNav/index.vue.js +33 -0
- package/dist/components/RouterNav/index.vue2.js +4 -0
- package/dist/components/Switch/index.js +6 -0
- package/dist/components/Switch/index.vue.js +7 -0
- package/dist/components/Switch/index.vue2.js +76 -0
- package/dist/components/Switch/types.js +6 -0
- package/dist/components/Table/index.js +6 -0
- package/dist/components/Table/index.vue.js +7 -0
- package/dist/components/Table/index.vue2.js +57 -0
- package/dist/components/Timer/index.js +6 -0
- package/dist/components/Timer/index.vue.js +31 -0
- package/dist/components/Timer/index.vue2.js +4 -0
- package/dist/components/Tooltip/TooltipContent.vue.js +33 -0
- package/dist/components/Tooltip/TooltipContent.vue2.js +4 -0
- package/dist/components/Tooltip/TooltipItem.vue.js +58 -0
- package/dist/components/Tooltip/TooltipItem.vue2.js +4 -0
- package/dist/components/Tooltip/TooltipLayer.vue.js +49 -0
- package/dist/components/Tooltip/TooltipLayer.vue2.js +4 -0
- package/dist/components/Tooltip/index.js +6 -0
- package/dist/components/Tooltip/index.vue.js +74 -0
- package/dist/components/Tooltip/index.vue2.js +4 -0
- package/dist/components/Tooltip/manager.js +105 -0
- package/dist/components/Tooltip/types.js +38 -0
- package/dist/components/Tooltip/useTooltip.js +43 -0
- package/dist/components/Warn/index.js +6 -0
- package/dist/components/Warn/index.vue.js +7 -0
- package/dist/components/Warn/index.vue2.js +21 -0
- package/dist/components/Warn/types.js +6 -0
- package/dist/components/Watermark/index.js +6 -0
- package/dist/components/Watermark/index.vue.js +7 -0
- package/dist/components/Watermark/index.vue2.js +54 -0
- package/dist/components/Watermark/types.js +10 -0
- package/dist/components/Watermark/useWatermarkBg.js +11 -0
- package/dist/components/helpers.js +25 -0
- package/dist/components.js +44 -0
- package/dist/directives/vBackTop.js +111 -0
- package/dist/directives/vDelayIn.js +41 -0
- package/dist/directives/vHoldPointer.js +112 -0
- package/dist/directives/vLazy.js +61 -0
- package/dist/directives/vLoading.js +49 -0
- package/dist/directives/vRipple.js +81 -0
- package/dist/directives/vSlideIn.js +39 -0
- package/dist/directives/vTextJump.js +50 -0
- package/dist/directives/vTooltip.js +55 -0
- package/dist/directives.js +20 -0
- package/dist/hooks/useAudio.js +112 -0
- package/dist/hooks/useElementScroll.js +30 -0
- package/dist/hooks/useGSAP.js +40 -0
- package/dist/hooks/useRefreshRate.js +26 -0
- package/dist/hooks/useWindowBackTop.js +86 -0
- package/dist/hooks.js +13 -0
- package/dist/icons/brands.js +592 -0
- package/dist/icons/regular.js +278 -0
- package/dist/icons/solid.js +2005 -0
- package/dist/index.js +135 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.js +448 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +401 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/node_modules/.pnpm/@floating-ui_vue@1.1.11_vue@3.5.34_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +131 -0
- package/dist/node_modules/.pnpm/@fortawesome_fontawesome-svg-core@7.2.0/node_modules/@fortawesome/fontawesome-svg-core/index.js +3102 -0
- package/dist/node_modules/.pnpm/@fortawesome_free-brands-svg-icons@7.2.0/node_modules/@fortawesome/free-brands-svg-icons/index.js +3380 -0
- package/dist/node_modules/.pnpm/@fortawesome_free-regular-svg-icons@7.2.0/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
- package/dist/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@7.2.0/node_modules/@fortawesome/free-solid-svg-icons/index.js +9694 -0
- package/dist/node_modules/.pnpm/@fortawesome_vue-fontawesom_b85c0ed4b0a431cb59a463de76a3e522/node_modules/@fortawesome/vue-fontawesome/index.es.js +528 -0
- package/dist/node_modules/.pnpm/gsap@3.15.0/node_modules/gsap/CSSPlugin.js +424 -0
- package/dist/node_modules/.pnpm/gsap@3.15.0/node_modules/gsap/gsap-core.js +1652 -0
- package/dist/node_modules/.pnpm/gsap@3.15.0/node_modules/gsap/index.js +13 -0
- package/dist/tttb.css +1 -0
- package/dist/types/bundle.d.ts +10 -0
- package/dist/types/components/Button/index.d.ts +22 -0
- package/dist/types/components/Button/types.d.ts +12 -0
- package/dist/types/components/Checkbox/index.d.ts +29 -0
- package/dist/types/components/Checkbox/types.d.ts +8 -0
- package/dist/types/components/Collapse/index.d.ts +28 -0
- package/dist/types/components/Collapse/types.d.ts +16 -0
- package/dist/types/components/CollapseItem/index.d.ts +27 -0
- package/dist/types/components/CollapseItem/types.d.ts +6 -0
- package/dist/types/components/Dialog/DialogItem.d.ts +38 -0
- package/dist/types/components/Dialog/DialogPrompt.d.ts +16 -0
- package/dist/types/components/Dialog/index.d.ts +10 -0
- package/dist/types/components/Dialog/types.d.ts +58 -0
- package/dist/types/components/Icon/index.d.ts +3 -0
- package/dist/types/components/Icon/types.d.ts +2 -0
- package/dist/types/components/Loading/index.d.ts +6 -0
- package/dist/types/components/Loading/types.d.ts +8 -0
- package/dist/types/components/Message/index.d.ts +9 -0
- package/dist/types/components/Message/types.d.ts +13 -0
- package/dist/types/components/Modal/index.d.ts +21 -0
- package/dist/types/components/Modal/types.d.ts +11 -0
- package/dist/types/components/Nav/index.d.ts +7 -0
- package/dist/types/components/Nav/types.d.ts +15 -0
- package/dist/types/components/Pagination/index.d.ts +18 -0
- package/dist/types/components/Pagination/types.d.ts +16 -0
- package/dist/types/components/Popconfirm/index.d.ts +262 -0
- package/dist/types/components/Popconfirm/types.d.ts +27 -0
- package/dist/types/components/Popover/index.d.ts +150 -0
- package/dist/types/components/Progress/index.d.ts +21 -0
- package/dist/types/components/Progress/types.d.ts +9 -0
- package/dist/types/components/RouterNav/index.d.ts +2 -0
- package/dist/types/components/Switch/index.d.ts +13 -0
- package/dist/types/components/Switch/types.d.ts +6 -0
- package/dist/types/components/Table/index.d.ts +35 -0
- package/dist/types/components/Table/types.d.ts +4 -0
- package/dist/types/components/Timer/index.d.ts +6 -0
- package/dist/types/components/Tooltip/TooltipContent.d.ts +17 -0
- package/dist/types/components/Tooltip/TooltipItem.d.ts +45 -0
- package/dist/types/components/Tooltip/TooltipLayer.d.ts +2 -0
- package/dist/types/components/Tooltip/index.d.ts +42 -0
- package/dist/types/components/Tooltip/manager.d.ts +18 -0
- package/dist/types/components/Tooltip/types.d.ts +54 -0
- package/dist/types/components/Tooltip/useTooltip.d.ts +8 -0
- package/dist/types/components/Warn/index.d.ts +20 -0
- package/dist/types/components/Warn/types.d.ts +6 -0
- package/dist/types/components/Watermark/index.d.ts +28 -0
- package/dist/types/components/Watermark/types.d.ts +14 -0
- package/dist/types/components/Watermark/useWatermarkBg.d.ts +6 -0
- package/dist/types/components/helpers.d.ts +14 -0
- package/dist/types/components/index.d.ts +21 -0
- package/dist/types/directives/index.d.ts +9 -0
- package/dist/types/directives/vBackTop.d.ts +3 -0
- package/dist/types/directives/vDelayIn.d.ts +3 -0
- package/dist/types/directives/vHoldPointer.d.ts +3 -0
- package/dist/types/directives/vLazy.d.ts +3 -0
- package/dist/types/directives/vLoading.d.ts +3 -0
- package/dist/types/directives/vRipple.d.ts +3 -0
- package/dist/types/directives/vSlideIn.d.ts +3 -0
- package/dist/types/directives/vTextJump.d.ts +3 -0
- package/dist/types/directives/vTooltip.d.ts +7 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/useAudio.d.ts +38 -0
- package/dist/types/hooks/useElementScroll.d.ts +32 -0
- package/dist/types/hooks/useGSAP.d.ts +34 -0
- package/dist/types/hooks/useRefreshRate.d.ts +5 -0
- package/dist/types/hooks/useWindowBackTop.d.ts +14 -0
- package/dist/types/icons/brands.d.ts +589 -0
- package/dist/types/icons/regular.d.ts +275 -0
- package/dist/types/icons/solid.d.ts +2002 -0
- package/dist/types/router/index.d.ts +2 -0
- package/dist/types/utils/chance.d.ts +7 -0
- package/dist/types/utils/copyToClipboard.d.ts +6 -0
- package/dist/types/utils/debounce.d.ts +16 -0
- package/dist/types/utils/deepClone.d.ts +6 -0
- package/dist/types/utils/deepEqual.d.ts +5 -0
- package/dist/types/utils/dialog.d.ts +12 -0
- package/dist/types/utils/getId.d.ts +6 -0
- package/dist/types/utils/getRandomColor.d.ts +4 -0
- package/dist/types/utils/getRandomInt.d.ts +6 -0
- package/dist/types/utils/getRandomStr.d.ts +6 -0
- package/dist/types/utils/index.d.ts +23 -0
- package/dist/types/utils/injectStyles.d.ts +9 -0
- package/dist/types/utils/isElementOverflow.d.ts +20 -0
- package/dist/types/utils/isEmpty.d.ts +6 -0
- package/dist/types/utils/isMobile.d.ts +6 -0
- package/dist/types/utils/isObject.d.ts +4 -0
- package/dist/types/utils/isPromise.d.ts +6 -0
- package/dist/types/utils/localStorage.d.ts +24 -0
- package/dist/types/utils/msg.d.ts +20 -0
- package/dist/types/utils/omit.d.ts +6 -0
- package/dist/types/utils/pick.d.ts +6 -0
- package/dist/types/utils/sessionStorage.d.ts +24 -0
- package/dist/types/utils/shuffleArray.d.ts +6 -0
- package/dist/types/utils/throttle.d.ts +9 -0
- package/dist/types/views/TestButton.d.ts +2 -0
- package/dist/types/views/TestCheckbox.d.ts +2 -0
- package/dist/types/views/TestCollapse.d.ts +2 -0
- package/dist/types/views/TestDialog.d.ts +2 -0
- package/dist/types/views/TestHome.d.ts +2 -0
- package/dist/types/views/TestIcon.d.ts +2 -0
- package/dist/types/views/TestMessage.d.ts +2 -0
- package/dist/types/views/TestModal.d.ts +2 -0
- package/dist/types/views/TestNav.d.ts +2 -0
- package/dist/types/views/TestPager.d.ts +2 -0
- package/dist/types/views/TestPopconfirm.d.ts +4 -0
- package/dist/types/views/TestProgress.d.ts +2 -0
- package/dist/types/views/TestSwitch.d.ts +2 -0
- package/dist/types/views/TestTable.d.ts +2 -0
- package/dist/types/views/TestTimer.d.ts +19 -0
- package/dist/types/views/TestTooltip.d.ts +2 -0
- package/dist/types/views/TestVLoading.d.ts +2 -0
- package/dist/types/views/TestWarn.d.ts +2 -0
- package/dist/types/views/TestWatermark.d.ts +2 -0
- package/dist/utils/chance.js +7 -0
- package/dist/utils/copyToClipboard.js +19 -0
- package/dist/utils/debounce.js +14 -0
- package/dist/utils/deepClone.js +17 -0
- package/dist/utils/deepEqual.js +40 -0
- package/dist/utils/dialog.js +47 -0
- package/dist/utils/getId.js +10 -0
- package/dist/utils/getRandomColor.js +4 -0
- package/dist/utils/getRandomInt.js +4 -0
- package/dist/utils/getRandomStr.js +5 -0
- package/dist/utils/injectStyles.js +24 -0
- package/dist/utils/isElementOverflow.js +22 -0
- package/dist/utils/isEmpty.js +4 -0
- package/dist/utils/isMobile.js +7 -0
- package/dist/utils/isObject.js +4 -0
- package/dist/utils/isPromise.js +7 -0
- package/dist/utils/localStorage.js +50 -0
- package/dist/utils/msg.js +24 -0
- package/dist/utils/omit.js +9 -0
- package/dist/utils/pick.js +9 -0
- package/dist/utils/sessionStorage.js +47 -0
- package/dist/utils/shuffleArray.js +10 -0
- package/dist/utils/throttle.js +11 -0
- package/dist/utils.js +50 -0
- package/package.json +102 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 防抖函数接口定义,包含 cancel 方法
|
|
3
|
+
*/
|
|
4
|
+
type AnyFunc = (this: unknown, ...args: never[]) => unknown;
|
|
5
|
+
interface DebouncedFunc<T extends AnyFunc> {
|
|
6
|
+
(...args: Parameters<T>): void;
|
|
7
|
+
cancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 防抖函数
|
|
11
|
+
* 返回一个新函数,在规定时间内只执行最后一次调用,新函数具有 cancel 方法可以取消等待执行的函数
|
|
12
|
+
* @param func 目标函数
|
|
13
|
+
* @param duration 冷却时间(毫秒)
|
|
14
|
+
*/
|
|
15
|
+
export declare const debounce: <T extends AnyFunc>(func: T, duration?: number) => DebouncedFunc<T>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AlertDialogOptions, ConfirmDialogOptions, DialogPromptResult, PromptDialogOptions } from '../components/Dialog/types';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
type DialogContentInput = string | VNode;
|
|
4
|
+
type AlertDialogInput = DialogContentInput | AlertDialogOptions;
|
|
5
|
+
type ConfirmDialogInput = DialogContentInput | ConfirmDialogOptions;
|
|
6
|
+
export declare const dialog: {
|
|
7
|
+
destroy: () => void | undefined;
|
|
8
|
+
confirm: (options: ConfirmDialogInput) => Promise<boolean>;
|
|
9
|
+
alert: (options: AlertDialogInput) => Promise<boolean>;
|
|
10
|
+
prompt: (options: PromptDialogOptions) => Promise<false | DialogPromptResult>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -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,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,24 @@
|
|
|
1
|
+
declare const localStorageUtil: {
|
|
2
|
+
/**
|
|
3
|
+
* 获取本地存储数据
|
|
4
|
+
* @param key 键名
|
|
5
|
+
* @returns 解析后的数据或 null
|
|
6
|
+
*/
|
|
7
|
+
get<T = unknown>(key: string): T | null;
|
|
8
|
+
/**
|
|
9
|
+
* 设置本地存储数据
|
|
10
|
+
* @param key 键名
|
|
11
|
+
* @param value 值(如果不是字符串会自动 JSON.stringify)
|
|
12
|
+
*/
|
|
13
|
+
set<T = unknown>(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,20 @@
|
|
|
1
|
+
import { default as Message } from '../components/Message';
|
|
2
|
+
import { MsgContent } from '../components/Message/types';
|
|
3
|
+
export type MessageType = 'success' | 'error' | 'warning' | 'info' | 'primary';
|
|
4
|
+
type MessageOptions = {
|
|
5
|
+
content: MsgContent;
|
|
6
|
+
type: MessageType;
|
|
7
|
+
};
|
|
8
|
+
type Content = Parameters<InstanceType<typeof Message>['add']>[0];
|
|
9
|
+
interface MessageApi {
|
|
10
|
+
(options: MessageOptions): void;
|
|
11
|
+
(content: Content, type?: MessageType): void;
|
|
12
|
+
success: (content: Content) => void;
|
|
13
|
+
error: (content: Content) => void;
|
|
14
|
+
warning: (content: Content) => void;
|
|
15
|
+
info: (content: Content) => void;
|
|
16
|
+
primary: (content: Content) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const msg: MessageApi;
|
|
19
|
+
export declare const message: MessageApi;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const sessionStorageUtil: {
|
|
2
|
+
/**
|
|
3
|
+
* 获取本地存储数据
|
|
4
|
+
* @param key 键名
|
|
5
|
+
* @returns 解析后的数据或 null
|
|
6
|
+
*/
|
|
7
|
+
get<T = unknown>(key: string): T | null;
|
|
8
|
+
/**
|
|
9
|
+
* 设置本地存储数据
|
|
10
|
+
* @param key 键名
|
|
11
|
+
* @param value 值(会自动 JSON.stringify)
|
|
12
|
+
*/
|
|
13
|
+
set<T = unknown>(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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 节流函数
|
|
3
|
+
* 返回一个新函数,在规定时间内只执行第一次调用
|
|
4
|
+
* @param func 目标函数
|
|
5
|
+
* @param wait 冷却时间(毫秒)
|
|
6
|
+
*/
|
|
7
|
+
type AnyFunc = (this: unknown, ...args: never[]) => unknown;
|
|
8
|
+
export declare const throttle: <T extends AnyFunc>(func: T, wait: number) => ((...args: Parameters<T>) => void);
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
container: HTMLDivElement;
|
|
3
|
+
}, HTMLDivElement>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
timerRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {
|
|
3
|
+
start: (s?: number) => void;
|
|
4
|
+
stop: () => void;
|
|
5
|
+
getTime: () => number;
|
|
6
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLSpanElement, import('vue').ComponentProvideOptions, {
|
|
7
|
+
P: {};
|
|
8
|
+
B: {};
|
|
9
|
+
D: {};
|
|
10
|
+
C: {};
|
|
11
|
+
M: {};
|
|
12
|
+
Defaults: {};
|
|
13
|
+
}, Readonly<{}> & Readonly<{}>, {
|
|
14
|
+
start: (s?: number) => void;
|
|
15
|
+
stop: () => void;
|
|
16
|
+
getTime: () => number;
|
|
17
|
+
}, {}, {}, {}, {}> | null;
|
|
18
|
+
}, HTMLDivElement>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
async function r(e) {
|
|
2
|
+
if (navigator?.clipboard?.writeText)
|
|
3
|
+
try {
|
|
4
|
+
return await navigator.clipboard.writeText(e), e;
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
return c(e);
|
|
8
|
+
}
|
|
9
|
+
function c(e) {
|
|
10
|
+
const o = document.createElement("textarea");
|
|
11
|
+
o.value = e, o.style.display = "none", document.body.appendChild(o), o.focus(), o.select();
|
|
12
|
+
const a = document.execCommand("copy");
|
|
13
|
+
if (o.remove(), !a)
|
|
14
|
+
throw new Error("Fallback: Copy command was unsuccessful");
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
r as copyToClipboard
|
|
19
|
+
};
|
|
@@ -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,47 @@
|
|
|
1
|
+
import s from "../components/Dialog/index.js";
|
|
2
|
+
import { h as m, render as l, isVNode as p } from "vue";
|
|
3
|
+
import { isObject as d } from "./isObject.js";
|
|
4
|
+
import "./localStorage.js";
|
|
5
|
+
import "./msg.js";
|
|
6
|
+
import "./sessionStorage.js";
|
|
7
|
+
const u = (r) => typeof r == "string" || p(r);
|
|
8
|
+
let e = null, o = null;
|
|
9
|
+
const n = document.createElement("div");
|
|
10
|
+
n.id = "dialog-container";
|
|
11
|
+
const f = (r) => {
|
|
12
|
+
if (typeof r == "string")
|
|
13
|
+
return { label: r, value: "" };
|
|
14
|
+
if (d(r))
|
|
15
|
+
return { value: "", ...r };
|
|
16
|
+
throw new Error("Prompt content must be an array of strings or objects");
|
|
17
|
+
}, y = (r) => {
|
|
18
|
+
if (!Array.isArray(r.content))
|
|
19
|
+
throw new Error("Prompt content must be an array");
|
|
20
|
+
r.content = r.content.map(f);
|
|
21
|
+
}, g = (r, a) => {
|
|
22
|
+
if (Array.isArray(r))
|
|
23
|
+
throw new Error("Dialog params cannot be an array");
|
|
24
|
+
let t = {};
|
|
25
|
+
return u(r) ? t = { content: r } : t = { ...r }, a === "prompt" && y(t), { ...t, type: a };
|
|
26
|
+
}, h = () => {
|
|
27
|
+
e || (e = m(s, {
|
|
28
|
+
onDestroy: () => {
|
|
29
|
+
l(null, n), e = null, o = null, n.parentNode && n.parentNode.removeChild(n);
|
|
30
|
+
}
|
|
31
|
+
}), document.body.appendChild(n), l(e, n), o = e.component?.exposed ?? null);
|
|
32
|
+
}, w = () => {
|
|
33
|
+
if (h(), !o)
|
|
34
|
+
throw new Error("Dialog instance is not ready");
|
|
35
|
+
return o;
|
|
36
|
+
}, i = (r, a) => {
|
|
37
|
+
const t = w(), c = g(r, a);
|
|
38
|
+
return t.open(c);
|
|
39
|
+
}, z = {
|
|
40
|
+
destroy: () => o?.destroyAll(),
|
|
41
|
+
confirm: (r) => i(r, "confirm"),
|
|
42
|
+
alert: (r) => i(r, "alert"),
|
|
43
|
+
prompt: (r) => i(r, "prompt")
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
z as dialog
|
|
47
|
+
};
|
|
@@ -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
|
+
};
|