@pixelium/web-vue 0.0.2 → 0.0.3-alpha
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/README.zh.md +6 -3
- package/dist/font.css +1 -1
- package/dist/index.d.ts +1602 -248
- package/dist/normalize.css +2 -0
- package/dist/pixelium-vue-icon-hn.cjs +1 -1
- package/dist/pixelium-vue-icon-hn.css +2 -1
- package/dist/pixelium-vue-icon-hn.js +8533 -8154
- package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
- package/dist/pixelium-vue-icon-pa.cjs +1 -1
- package/dist/pixelium-vue-icon-pa.css +2 -1
- package/dist/pixelium-vue-icon-pa.js +10625 -10143
- package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
- package/dist/pixelium-vue.cjs +2 -2
- package/dist/pixelium-vue.css +2 -1
- package/dist/pixelium-vue.js +7407 -5852
- package/dist/pixelium-vue.umd.cjs +2 -2
- package/es/aside/index.css +1 -0
- package/es/aside/index.js +46 -151
- package/es/auto-complete/draw.d.ts +1 -1
- package/es/auto-complete/draw.js +26 -51
- package/es/auto-complete/index.css +92 -32
- package/es/auto-complete/index.d.ts +12 -15
- package/es/auto-complete/index.js +338 -400
- package/es/auto-complete/type.d.ts +25 -13
- package/es/avatar/css.js +2 -0
- package/es/avatar/draw.d.ts +2 -0
- package/es/avatar/draw.js +11 -0
- package/es/avatar/index.css +49 -0
- package/es/avatar/index.d.ts +15 -0
- package/es/avatar/index.js +110 -0
- package/es/avatar/type.d.ts +34 -0
- package/es/button/draw.d.ts +4 -4
- package/es/button/draw.js +213 -297
- package/es/button/index.css +40 -30
- package/es/button/index.d.ts +0 -4
- package/es/button/index.js +230 -256
- package/es/button/type.d.ts +3 -3
- package/es/button-group/index.css +0 -3
- package/es/button-group/index.d.ts +1 -2
- package/es/button-group/index.js +59 -31
- package/es/button-group/type.d.ts +21 -4
- package/es/checkbox/css.js +2 -0
- package/es/checkbox/draw.d.ts +4 -0
- package/es/checkbox/draw.js +46 -0
- package/es/checkbox/index.css +85 -0
- package/es/checkbox/index.d.ts +31 -0
- package/es/checkbox/index.js +206 -0
- package/es/checkbox/type.d.ts +88 -0
- package/es/checkbox-group/css.js +2 -0
- package/es/checkbox-group/index.css +20 -0
- package/es/checkbox-group/index.d.ts +23 -0
- package/es/checkbox-group/index.js +84 -0
- package/es/checkbox-group/type.d.ts +78 -0
- package/es/col/index.d.ts +2 -2
- package/es/col/index.js +43 -58
- package/es/container/index.css +1 -0
- package/es/container/index.js +18 -31
- package/es/divider/index.js +39 -53
- package/es/empty/index.css +4 -4
- package/es/empty/index.js +16 -71
- package/es/entry.js +102 -0
- package/es/footer/index.css +1 -0
- package/es/footer/index.js +31 -40
- package/es/form/css.js +1 -0
- package/es/form/index.d.ts +27 -0
- package/es/form/index.js +125 -0
- package/es/form/type.d.ts +238 -0
- package/es/form/use-form.d.ts +4 -0
- package/es/form/use-form.js +48 -0
- package/es/form-item/css.js +2 -0
- package/es/form-item/index.css +77 -0
- package/es/form-item/index.d.ts +37 -0
- package/es/form-item/index.js +318 -0
- package/es/form-item/type.d.ts +96 -0
- package/es/grid/index.js +56 -75
- package/es/grid-item/css.js +0 -1
- package/es/grid-item/index.d.ts +1 -1
- package/es/grid-item/index.js +85 -121
- package/es/header/index.css +1 -0
- package/es/header/index.js +31 -40
- package/es/icon/index.js +44 -55
- package/es/icons/css-hn.js +0 -1
- package/es/icons/css-pa.js +0 -1
- package/es/icons/icon-hn.js +10337 -15986
- package/es/icons/icon-pa.js +12573 -17447
- package/es/image/css.js +2 -0
- package/es/image/index.css +69 -0
- package/es/image/index.d.ts +35 -0
- package/es/image/index.js +199 -0
- package/es/image/type.d.ts +126 -0
- package/es/index.css +1 -515
- package/es/index.d.ts +22 -2
- package/es/index.js +144 -123
- package/es/input/draw.d.ts +1 -1
- package/es/input/draw.js +26 -51
- package/es/input/index.css +85 -33
- package/es/input/index.d.ts +9 -16
- package/es/input/index.js +319 -423
- package/es/input/type.d.ts +3 -3
- package/es/input-group/index.css +0 -1
- package/es/input-group/index.d.ts +2 -2
- package/es/input-group/index.js +66 -37
- package/es/input-group/type.d.ts +16 -4
- package/es/input-group-label/draw.d.ts +1 -1
- package/es/input-group-label/draw.js +26 -51
- package/es/input-group-label/index.css +33 -22
- package/es/input-group-label/index.d.ts +1 -4
- package/es/input-group-label/index.js +104 -127
- package/es/input-group-label/type.d.ts +3 -3
- package/es/input-number/draw.d.ts +1 -1
- package/es/input-number/draw.js +26 -51
- package/es/input-number/index.css +90 -35
- package/es/input-number/index.d.ts +9 -16
- package/es/input-number/index.js +428 -536
- package/es/input-number/type.d.ts +3 -3
- package/es/input-tag/draw.d.ts +1 -1
- package/es/input-tag/draw.js +26 -48
- package/es/input-tag/index.css +100 -33
- package/es/input-tag/index.d.ts +7 -13
- package/es/input-tag/index.js +442 -467
- package/es/input-tag/type.d.ts +24 -13
- package/es/link/index.js +75 -106
- package/es/main/index.css +4 -0
- package/es/main/index.d.ts +4 -1
- package/es/main/index.js +15 -15
- package/es/main/type.d.ts +7 -0
- package/es/mask/index.js +94 -115
- package/es/message/index.css +1 -1
- package/es/message/index.js +168 -346
- package/es/message-box/css.js +1 -1
- package/es/message-box/index.js +98 -114
- package/es/message-box/message-box-wrapped.js +33 -46
- package/es/message-box/message-box.js +79 -111
- package/es/option-list/index.css +13 -13
- package/es/option-list/index.d.ts +4 -31
- package/es/option-list/index.js +99 -167
- package/es/option-list/type.d.ts +5 -1
- package/es/pixelate/pixel.d.ts +5 -0
- package/es/pixelate/pixel.js +70 -0
- package/es/pixelate/pixelate.worker.d.ts +1 -0
- package/es/popover/index.d.ts +13 -99
- package/es/popover/index.js +75 -238
- package/es/popover/type.d.ts +7 -2
- package/es/popup/css.js +1 -0
- package/es/popup/index.d.ts +210 -0
- package/es/popup/index.js +203 -0
- package/es/popup/type.d.ts +105 -0
- package/es/popup-content/draw.d.ts +2 -2
- package/es/popup-content/draw.js +98 -143
- package/es/popup-content/index.css +11 -11
- package/es/popup-content/index.d.ts +1 -0
- package/es/popup-content/index.js +253 -1576
- package/es/popup-content/type.d.ts +1 -0
- package/es/popup-trigger/index.d.ts +8 -2
- package/es/popup-trigger/index.js +122 -95
- package/es/popup-trigger/type.d.ts +4 -1
- package/es/popup-wrapper/css.js +2 -0
- package/es/popup-wrapper/index.css +14 -0
- package/es/popup-wrapper/index.d.ts +18 -0
- package/es/popup-wrapper/index.js +67 -0
- package/es/popup-wrapper/type.d.ts +9 -0
- package/es/radio/css.js +1 -0
- package/es/radio/draw.d.ts +4 -0
- package/es/radio/draw.js +47 -0
- package/es/radio/index.d.ts +30 -0
- package/es/radio/index.js +190 -0
- package/es/radio/style.css +73 -0
- package/es/radio/type.d.ts +76 -0
- package/es/radio-group/css.js +2 -0
- package/es/radio-group/index.css +20 -0
- package/es/radio-group/index.d.ts +23 -0
- package/es/radio-group/index.js +77 -0
- package/es/radio-group/type.d.ts +77 -0
- package/es/row/index.js +56 -70
- package/es/select/draw.d.ts +1 -1
- package/es/select/draw.js +26 -51
- package/es/select/index.css +118 -36
- package/es/select/index.d.ts +14 -16
- package/es/select/index.js +625 -672
- package/es/select/type.d.ts +60 -25
- package/es/share/const/event-bus-key.js +1 -6
- package/es/share/const/index.d.ts +4 -0
- package/es/share/const/index.js +22 -24
- package/es/share/const/provide-key.d.ts +5 -0
- package/es/share/const/provide-key.js +6 -5
- package/es/share/const/style.d.ts +6 -0
- package/es/share/const/style.js +7 -0
- package/es/share/hook/use-cancelable-delay.d.ts +1 -0
- package/es/share/hook/use-cancelable-delay.js +42 -0
- package/es/share/hook/use-click-outside-listener.d.ts +1 -1
- package/es/share/hook/use-click-outside-listener.js +28 -41
- package/es/share/hook/use-composition.js +17 -15
- package/es/share/hook/use-controlled-mode.d.ts +3 -3
- package/es/share/hook/use-controlled-mode.js +20 -23
- package/es/share/hook/use-dark-mode.js +51 -65
- package/es/share/hook/use-index-of-children.d.ts +2 -1
- package/es/share/hook/use-index-of-children.js +47 -45
- package/es/share/hook/use-lazy-load.d.ts +10 -0
- package/es/share/hook/use-lazy-load.js +133 -0
- package/es/share/hook/use-props-detect.d.ts +2 -0
- package/es/share/hook/use-resize-observer.d.ts +1 -2
- package/es/share/hook/use-resize-observer.js +28 -20
- package/es/share/hook/use-screen-width.js +27 -36
- package/es/share/hook/use-smooth-transition.d.ts +2 -0
- package/es/share/hook/use-smooth-transition.js +65 -0
- package/es/share/hook/use-textarea-height.js +86 -92
- package/es/share/hook/use-theme-mode.js +41 -42
- package/es/share/hook/use-transition-end.d.ts +2 -0
- package/es/share/hook/use-transition-end.js +12 -0
- package/es/share/hook/use-watch-global-css-var.js +12 -16
- package/es/share/hook/use-window-resize-listener.d.ts +1 -0
- package/es/share/hook/use-window-resize-listener.js +15 -0
- package/es/share/hook/use-z-index.js +30 -27
- package/es/share/style/index.css +5 -0
- package/es/share/type/index.d.ts +18 -3
- package/es/share/util/color.d.ts +5 -3
- package/es/share/util/color.js +156 -149
- package/es/share/util/common.d.ts +7 -2
- package/es/share/util/common.js +127 -65
- package/es/share/util/console.d.ts +3 -3
- package/es/share/util/console.js +10 -7
- package/es/share/util/dom.d.ts +19 -0
- package/es/share/util/dom.js +88 -0
- package/es/share/util/env.d.ts +1 -0
- package/es/share/util/env.js +5 -4
- package/es/share/util/event-bus.js +3 -20
- package/es/share/util/lru-cache.js +29 -33
- package/es/share/util/pixel.d.ts +4 -0
- package/es/share/util/plot.d.ts +8 -3
- package/es/share/util/plot.js +457 -229
- package/es/share/util/reactivity.d.ts +8 -0
- package/es/share/util/reactivity.js +23 -0
- package/es/share/util/render.js +31 -41
- package/es/share/util/theme.d.ts +3 -0
- package/es/share/util/theme.js +77 -57
- package/es/slider/css.js +2 -0
- package/es/slider/draw.d.ts +25 -0
- package/es/slider/draw.js +113 -0
- package/es/slider/index.css +119 -0
- package/es/slider/index.d.ts +66 -0
- package/es/slider/index.js +503 -0
- package/es/slider/type.d.ts +162 -0
- package/es/slider/util.d.ts +37 -0
- package/es/slider/util.js +130 -0
- package/es/space/index.css +24 -29
- package/es/space/index.js +73 -97
- package/es/spin/index.css +18 -17
- package/es/spin/index.js +72 -102
- package/es/spin/type.d.ts +11 -5
- package/es/switch/css.js +2 -0
- package/es/switch/draw.d.ts +2 -0
- package/es/switch/draw.js +18 -0
- package/es/switch/index.css +121 -0
- package/es/switch/index.d.ts +42 -0
- package/es/switch/index.js +259 -0
- package/es/switch/type.d.ts +133 -0
- package/es/tag/draw.d.ts +2 -2
- package/es/tag/draw.js +80 -127
- package/es/tag/index.css +38 -22
- package/es/tag/index.d.ts +2 -2
- package/es/tag/index.js +121 -190
- package/es/tag/type.d.ts +3 -3
- package/es/text-outline/css.js +2 -0
- package/es/text-outline/index.css +4 -0
- package/es/text-outline/index.d.ts +17 -0
- package/es/text-outline/index.js +33 -0
- package/es/text-outline/type.d.ts +23 -0
- package/es/textarea/draw.js +9 -11
- package/es/textarea/index.css +37 -23
- package/es/textarea/index.d.ts +8 -14
- package/es/textarea/index.js +274 -262
- package/es/tooltip/index.d.ts +100 -4
- package/es/tooltip/index.js +70 -226
- package/es/tooltip/type.d.ts +7 -2
- package/es/vendor.js +504 -0
- package/es/virtual-list/css.js +2 -0
- package/es/virtual-list/index.css +25 -0
- package/es/virtual-list/index.d.ts +11 -0
- package/es/virtual-list/index.js +313 -0
- package/es/virtual-list/type.d.ts +26 -0
- package/package.json +10 -16
- package/es/grid-item/index.css +0 -0
- /package/es/message-box/{message-box.css → index.css} +0 -0
package/es/tooltip/index.d.ts
CHANGED
|
@@ -1,10 +1,105 @@
|
|
|
1
1
|
import type { TooltipProps } from './type';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<TooltipProps, {
|
|
3
|
-
|
|
2
|
+
declare const _default: import("vue").DefineComponent<TooltipProps, {
|
|
3
|
+
readonly triggerContent: ({
|
|
4
|
+
$: import("vue").ComponentInternalInstance;
|
|
5
|
+
$data: {};
|
|
6
|
+
$props: {
|
|
7
|
+
readonly content?: string | undefined;
|
|
8
|
+
readonly visible?: boolean | null | undefined;
|
|
9
|
+
readonly defaultVisible?: boolean | null | undefined;
|
|
10
|
+
readonly placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | undefined;
|
|
11
|
+
readonly offset?: number | undefined;
|
|
12
|
+
readonly variant?: "dark" | "light" | undefined;
|
|
13
|
+
readonly arrow?: boolean | undefined;
|
|
14
|
+
readonly zIndex?: number | undefined;
|
|
15
|
+
readonly target?: (HTMLElement | import("vue").VNode | null) | undefined;
|
|
16
|
+
readonly root?: (HTMLElement | string) | undefined;
|
|
17
|
+
readonly borderRadius?: number | undefined;
|
|
18
|
+
readonly widthEqual?: boolean | undefined;
|
|
19
|
+
readonly contentStyle?: import("vue").CSSProperties | undefined;
|
|
20
|
+
readonly destroyOnHide?: boolean | undefined;
|
|
21
|
+
readonly onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
|
|
22
|
+
readonly onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
|
|
23
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
24
|
+
$attrs: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
$refs: {
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
$slots: Readonly<{
|
|
31
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
34
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
35
|
+
$host: Element | null;
|
|
36
|
+
$emit: ((event: "contentMouseenter", e: MouseEvent) => void) & ((event: "contentMouseleave", e: MouseEvent) => void);
|
|
37
|
+
$el: any;
|
|
38
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("../popup-content/type.ts").PopupContentProps> & Readonly<{
|
|
39
|
+
onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
|
|
40
|
+
onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
updateRenderState: () => void;
|
|
43
|
+
content: import("vue").ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
|
|
44
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
+
contentMouseenter: (e: MouseEvent) => any;
|
|
46
|
+
contentMouseleave: (e: MouseEvent) => any;
|
|
47
|
+
}, string, {
|
|
48
|
+
variant: "dark" | "light";
|
|
49
|
+
placement: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
|
|
50
|
+
root: HTMLElement | string;
|
|
51
|
+
offset: number;
|
|
52
|
+
visible: boolean | null;
|
|
53
|
+
arrow: boolean;
|
|
54
|
+
widthEqual: boolean;
|
|
55
|
+
destroyOnHide: boolean;
|
|
56
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
57
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
58
|
+
created?: (() => void) | (() => void)[];
|
|
59
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
60
|
+
mounted?: (() => void) | (() => void)[];
|
|
61
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
62
|
+
updated?: (() => void) | (() => void)[];
|
|
63
|
+
activated?: (() => void) | (() => void)[];
|
|
64
|
+
deactivated?: (() => void) | (() => void)[];
|
|
65
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
66
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
67
|
+
destroyed?: (() => void) | (() => void)[];
|
|
68
|
+
unmounted?: (() => void) | (() => void)[];
|
|
69
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
70
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
71
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
72
|
+
};
|
|
73
|
+
$forceUpdate: () => void;
|
|
74
|
+
$nextTick: typeof import("vue").nextTick;
|
|
75
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, ((cleanupFn: () => void) => void)]) => any : (...args: [any, any, ((cleanupFn: () => void) => void)]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
76
|
+
} & Readonly<{
|
|
77
|
+
variant: "dark" | "light";
|
|
78
|
+
placement: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
|
|
79
|
+
root: HTMLElement | string;
|
|
80
|
+
offset: number;
|
|
81
|
+
visible: boolean | null;
|
|
82
|
+
arrow: boolean;
|
|
83
|
+
widthEqual: boolean;
|
|
84
|
+
destroyOnHide: boolean;
|
|
85
|
+
}> & Omit<Readonly<import("../popup-content/type.ts").PopupContentProps> & Readonly<{
|
|
86
|
+
onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
|
|
87
|
+
onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
|
|
88
|
+
}>, "content" | "updateRenderState" | ("variant" | "placement" | "root" | "offset" | "visible" | "arrow" | "widthEqual" | "destroyOnHide")> & import("vue").ShallowUnwrapRef<{
|
|
89
|
+
updateRenderState: () => void;
|
|
90
|
+
content: import("vue").ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
|
|
91
|
+
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
92
|
+
$slots: {
|
|
93
|
+
content?: (props: {}) => any;
|
|
94
|
+
};
|
|
95
|
+
}) | undefined;
|
|
96
|
+
updateRenderState(): void;
|
|
97
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
98
|
+
close: (e: MouseEvent | TouchEvent) => any;
|
|
4
99
|
open: (e: MouseEvent) => any;
|
|
5
100
|
"update:visible": (value: boolean) => any;
|
|
6
101
|
}, string, import("vue").PublicProps, Readonly<TooltipProps> & Readonly<{
|
|
7
|
-
onClose?: ((e: MouseEvent) => any) | undefined;
|
|
102
|
+
onClose?: ((e: MouseEvent | TouchEvent) => any) | undefined;
|
|
8
103
|
onOpen?: ((e: MouseEvent) => any) | undefined;
|
|
9
104
|
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
10
105
|
}>, {
|
|
@@ -14,7 +109,8 @@ declare const _default: import("vue").DefineComponent<TooltipProps, {}, {}, {},
|
|
|
14
109
|
offset: number;
|
|
15
110
|
visible: boolean | null;
|
|
16
111
|
defaultVisible: boolean | null;
|
|
17
|
-
arrow: boolean;
|
|
18
112
|
trigger: "hover" | "click";
|
|
113
|
+
arrow: boolean;
|
|
114
|
+
destroyOnHide: boolean;
|
|
19
115
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
116
|
export default _default;
|
package/es/tooltip/index.js
CHANGED
|
@@ -1,228 +1,72 @@
|
|
|
1
1
|
import './css.js'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
async function openHandlerImpl(node, controlled = false) {
|
|
72
|
-
if (inBrowser()) {
|
|
73
|
-
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
74
|
-
if (node.el instanceof HTMLElement) {
|
|
75
|
-
currentTrigger.value = node;
|
|
76
|
-
} else {
|
|
77
|
-
currentTrigger.value = null;
|
|
78
|
-
}
|
|
79
|
-
if (currentTrigger.value && currentTrigger.value.el instanceof HTMLElement) {
|
|
80
|
-
resizeObserver == null ? void 0 : resizeObserver.observe(currentTrigger.value.el);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (controlledMode.value && !controlled) {
|
|
84
|
-
emits("update:visible", true);
|
|
85
|
-
await nextTick(() => {
|
|
86
|
-
});
|
|
87
|
-
display.value = !!props.visible;
|
|
88
|
-
} else {
|
|
89
|
-
display.value = true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
async function closeHandler(e) {
|
|
93
|
-
if (props.trigger === "click") {
|
|
94
|
-
const clickContent = contentRef.value && contentRef.value.content && contentRef.value.content.contains(e.target);
|
|
95
|
-
if (clickContent || !display.value) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
if (closeDelayPromiseReject) {
|
|
100
|
-
closeDelayPromiseReject();
|
|
101
|
-
closeDelayPromiseReject = void 0;
|
|
102
|
-
}
|
|
103
|
-
const {
|
|
104
|
-
resolve,
|
|
105
|
-
reject,
|
|
106
|
-
promise
|
|
107
|
-
} = Promise.withResolvers();
|
|
108
|
-
closeDelayPromiseReject = reject;
|
|
109
|
-
setTimeout(() => {
|
|
110
|
-
resolve();
|
|
111
|
-
}, HOVER_CLOSE_DELAY);
|
|
112
|
-
try {
|
|
113
|
-
await promise;
|
|
114
|
-
} catch {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (controlledMode.value) {
|
|
119
|
-
emits("update:visible", false);
|
|
120
|
-
await nextTick(() => {
|
|
121
|
-
});
|
|
122
|
-
display.value = !!props.visible;
|
|
123
|
-
} else {
|
|
124
|
-
display.value = false;
|
|
125
|
-
}
|
|
126
|
-
emits("close", e);
|
|
127
|
-
}
|
|
128
|
-
const contentMouseenterHandler = () => {
|
|
129
|
-
if (props.trigger === "click") {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
if (closeDelayPromiseReject) {
|
|
133
|
-
closeDelayPromiseReject();
|
|
134
|
-
closeDelayPromiseReject = void 0;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const contentMouseleaveHandler = (e) => {
|
|
138
|
-
if (props.trigger === "click") {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
closeHandler(e);
|
|
142
|
-
};
|
|
143
|
-
const preprocessCurrentTrigger = () => {
|
|
144
|
-
if (!inBrowser()) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (!currentTrigger.value && triggerRef.value && triggerRef.value.firstVNode) {
|
|
148
|
-
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
149
|
-
currentTrigger.value = triggerRef.value.firstVNode;
|
|
150
|
-
if (currentTrigger.value.el instanceof HTMLElement) {
|
|
151
|
-
resizeObserver == null ? void 0 : resizeObserver.observe(currentTrigger.value.el);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
const processVisible = (value) => {
|
|
156
|
-
if (value) {
|
|
157
|
-
preprocessCurrentTrigger();
|
|
158
|
-
if (currentTrigger.value) {
|
|
159
|
-
openHandlerImpl(currentTrigger.value, true);
|
|
160
|
-
}
|
|
161
|
-
} else {
|
|
162
|
-
display.value = false;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
watch(() => props.visible, () => {
|
|
166
|
-
processVisible(!!props.visible);
|
|
167
|
-
});
|
|
168
|
-
const resizeObserver = inBrowser() ? new ResizeObserver(() => {
|
|
169
|
-
updateRenderState();
|
|
170
|
-
}) : null;
|
|
171
|
-
onMounted(() => {
|
|
172
|
-
nextTick(() => {
|
|
173
|
-
if (display.value) {
|
|
174
|
-
updateRenderState();
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
const updateRenderState = () => {
|
|
179
|
-
var _a;
|
|
180
|
-
preprocessCurrentTrigger();
|
|
181
|
-
if (inBrowser()) {
|
|
182
|
-
(_a = contentRef.value) == null ? void 0 : _a.updateRenderState();
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
const slots = useSlots();
|
|
186
|
-
const checkCurrentTrigger = (_) => {
|
|
187
|
-
var _a;
|
|
188
|
-
if (!inBrowser()) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
return ((_a = currentTrigger.value) == null ? void 0 : _a.el) instanceof HTMLElement;
|
|
192
|
-
};
|
|
193
|
-
return () => {
|
|
194
|
-
var _a;
|
|
195
|
-
return createVNode(Fragment, null, [createVNode(_sfc_main$1, {
|
|
196
|
-
"trigger": props.trigger,
|
|
197
|
-
"disabled": props.disabled,
|
|
198
|
-
"onClose": closeHandler,
|
|
199
|
-
"onOpen": openHandler,
|
|
200
|
-
"ref": (node) => triggerRef.value = node
|
|
201
|
-
}, {
|
|
202
|
-
default: () => {
|
|
203
|
-
var _a2;
|
|
204
|
-
return [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)];
|
|
205
|
-
}
|
|
206
|
-
}), createVNode(_sfc_main$2, {
|
|
207
|
-
"visible": display.value,
|
|
208
|
-
"content": props.content,
|
|
209
|
-
"zIndex": props.zIndex,
|
|
210
|
-
"variant": props.variant,
|
|
211
|
-
"placement": props.placement,
|
|
212
|
-
"arrow": props.arrow,
|
|
213
|
-
"offset": props.offset,
|
|
214
|
-
"borderRadius": BORDER_RADIUS,
|
|
215
|
-
"root": props.root,
|
|
216
|
-
"target": checkCurrentTrigger((_a = currentTrigger.value) == null ? void 0 : _a.el) ? currentTrigger.value.el : null,
|
|
217
|
-
"onContentMouseenter": contentMouseenterHandler,
|
|
218
|
-
"onContentMouseleave": contentMouseleaveHandler,
|
|
219
|
-
"ref": (node) => contentRef.value = node
|
|
220
|
-
}, {
|
|
221
|
-
content: slots.content
|
|
222
|
-
})]);
|
|
223
|
-
};
|
|
224
|
-
}
|
|
2
|
+
import { n as forwardEmits } from "../share/util/reactivity.js";
|
|
3
|
+
import { t as popup_default } from "../popup/index.js";
|
|
4
|
+
import { createVNode, defineComponent, mergeProps, shallowRef, useAttrs, useSlots } from "vue";
|
|
5
|
+
var tooltip_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "Tooltip",
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
content: null,
|
|
10
|
+
visible: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
defaultVisible: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
placement: { default: "top" },
|
|
19
|
+
trigger: { default: "hover" },
|
|
20
|
+
offset: { default: 8 },
|
|
21
|
+
variant: { default: "dark" },
|
|
22
|
+
arrow: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
disabled: { type: Boolean },
|
|
27
|
+
zIndex: null,
|
|
28
|
+
root: { default: "body" },
|
|
29
|
+
destroyOnHide: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: [
|
|
35
|
+
"update:visible",
|
|
36
|
+
"close",
|
|
37
|
+
"open"
|
|
38
|
+
],
|
|
39
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
40
|
+
const props = __props;
|
|
41
|
+
const attrs = useAttrs();
|
|
42
|
+
const emits = __emit;
|
|
43
|
+
const popupRef = shallowRef(null);
|
|
44
|
+
__expose({
|
|
45
|
+
get triggerContent() {
|
|
46
|
+
var _popupRef$value;
|
|
47
|
+
return (_popupRef$value = popupRef.value) === null || _popupRef$value === void 0 ? void 0 : _popupRef$value.triggerContent;
|
|
48
|
+
},
|
|
49
|
+
updateRenderState() {
|
|
50
|
+
var _popupRef$value2;
|
|
51
|
+
(_popupRef$value2 = popupRef.value) === null || _popupRef$value2 === void 0 || _popupRef$value2.updateRenderState();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const slots = useSlots();
|
|
55
|
+
const forward = forwardEmits(emits, [
|
|
56
|
+
"open",
|
|
57
|
+
"close",
|
|
58
|
+
"update:visible"
|
|
59
|
+
]);
|
|
60
|
+
return () => {
|
|
61
|
+
return createVNode(popup_default, mergeProps({ "ref": popupRef }, {
|
|
62
|
+
...props,
|
|
63
|
+
...forward,
|
|
64
|
+
...attrs
|
|
65
|
+
}), {
|
|
66
|
+
default: slots.default,
|
|
67
|
+
content: slots.content
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
}
|
|
225
71
|
});
|
|
226
|
-
export {
|
|
227
|
-
_sfc_main as _
|
|
228
|
-
};
|
|
72
|
+
export { tooltip_default as t };
|
package/es/tooltip/type.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type TooltipProps = {
|
|
|
45
45
|
*/
|
|
46
46
|
disabled?: boolean;
|
|
47
47
|
/**
|
|
48
|
-
* @property {number} [
|
|
48
|
+
* @property {number} [zIndex]
|
|
49
49
|
* @version 0.0.2
|
|
50
50
|
*/
|
|
51
51
|
zIndex?: number;
|
|
@@ -54,6 +54,11 @@ export type TooltipProps = {
|
|
|
54
54
|
* @version 0.0.2
|
|
55
55
|
*/
|
|
56
56
|
root?: HTMLElement | string;
|
|
57
|
+
/**
|
|
58
|
+
* @property {boolean} [destroyOnHide=false]
|
|
59
|
+
* @version 0.0.3
|
|
60
|
+
*/
|
|
61
|
+
destroyOnHide?: boolean;
|
|
57
62
|
};
|
|
58
63
|
export type TooltipEvents = {
|
|
59
64
|
/**
|
|
@@ -67,7 +72,7 @@ export type TooltipEvents = {
|
|
|
67
72
|
* @param {MouseEvent} e
|
|
68
73
|
* @version 0.0.2
|
|
69
74
|
*/
|
|
70
|
-
close: [e: MouseEvent];
|
|
75
|
+
close: [e: MouseEvent | TouchEvent];
|
|
71
76
|
/**
|
|
72
77
|
* @event open
|
|
73
78
|
* @param {MouseEvent} e
|