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.
- 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 +57 -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/Dialog/DialogItem.vue.js +7 -0
- package/dist/components/Dialog/DialogItem.vue2.js +78 -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 +81 -0
- package/dist/components/Icon/index.js +6 -0
- package/dist/components/Icon/index.vue.js +43 -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 +162 -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 +107 -0
- package/dist/components/Tooltip/types.js +21 -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 +40 -0
- package/dist/directives/vBackTop.js +110 -0
- package/dist/directives/vDelayIn.js +41 -0
- package/dist/directives/vHoldPointer.js +112 -0
- package/dist/directives/vLazy.js +65 -0
- package/dist/directives/vLoading.js +50 -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 +554 -0
- package/dist/icons/regular.js +278 -0
- package/dist/icons/solid.js +1989 -0
- package/dist/index.js +130 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +448 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +400 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/dist/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +131 -0
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +3074 -0
- package/dist/node_modules/@fortawesome/free-brands-svg-icons/index.js +3156 -0
- package/dist/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +9602 -0
- package/dist/node_modules/@fortawesome/vue-fontawesome/index.es.js +487 -0
- package/dist/node_modules/gsap/CSSPlugin.js +424 -0
- package/dist/node_modules/gsap/gsap-core.js +1645 -0
- package/dist/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/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 +35 -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 +12 -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 +14 -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 +266 -0
- package/dist/types/components/Popconfirm/types.d.ts +26 -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 +31 -0
- package/dist/types/components/Table/types.d.ts +3 -0
- package/dist/types/components/Timer/index.d.ts +6 -0
- package/dist/types/components/Tooltip/TooltipContent.d.ts +16 -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 +3384 -0
- package/dist/types/components/Tooltip/types.d.ts +52 -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 +19 -0
- package/dist/types/directives/helper.d.ts +4 -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 +8 -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 +32 -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 +551 -0
- package/dist/types/icons/regular.d.ts +275 -0
- package/dist/types/icons/solid.d.ts +1986 -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 +15 -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 +8 -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 +8 -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 +7 -0
- package/dist/utils/chance.js +7 -0
- package/dist/utils/copyToClipboard.js +21 -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 +43 -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 +4 -0
- package/dist/utils/localStorage.js +47 -0
- package/dist/utils/msg.js +21 -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 +49 -0
- package/package.json +95 -0
|
@@ -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,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,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 = 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,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,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,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,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,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
|
+
};
|