@whitesev/pops 2.4.6 → 2.4.7
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/dist/index.amd.js +578 -571
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +578 -571
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +578 -571
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +578 -571
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +578 -571
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +578 -571
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +252 -252
- package/dist/types/src/types/animation.d.ts +19 -19
- package/dist/types/src/types/button.d.ts +187 -187
- package/dist/types/src/types/components.d.ts +210 -210
- package/dist/types/src/types/event.d.ts +63 -63
- package/dist/types/src/types/global.d.ts +25 -25
- package/dist/types/src/types/icon.d.ts +32 -32
- package/dist/types/src/types/inst.d.ts +24 -24
- package/dist/types/src/types/main.d.ts +111 -111
- package/dist/types/src/types/mask.d.ts +49 -49
- package/dist/types/src/types/position.d.ts +60 -60
- package/index.ts +3 -0
- package/package.json +4 -2
- package/src/Pops.ts +206 -0
- package/src/PopsAnimation.ts +32 -0
- package/src/PopsCSS.ts +51 -0
- package/src/PopsCore.ts +64 -0
- package/src/PopsIcon.ts +95 -0
- package/src/PopsInst.ts +21 -0
- package/src/components/alert/config.ts +62 -0
- package/src/components/alert/index.css +0 -0
- package/src/components/alert/index.ts +163 -0
- package/src/components/alert/types/index.ts +23 -0
- package/src/components/confirm/config.ts +90 -0
- package/src/components/confirm/index.css +0 -0
- package/src/components/confirm/index.ts +166 -0
- package/src/components/confirm/types/index.ts +17 -0
- package/src/components/drawer/config.ts +89 -0
- package/src/components/drawer/index.css +37 -0
- package/src/components/drawer/index.ts +237 -0
- package/src/components/drawer/types/index.ts +61 -0
- package/src/components/folder/config.ts +147 -0
- package/src/components/folder/folderIcon.ts +28 -0
- package/src/components/folder/index.css +303 -0
- package/src/components/folder/index.ts +929 -0
- package/src/components/folder/types/index.ts +97 -0
- package/src/components/iframe/config.ts +60 -0
- package/src/components/iframe/index.css +76 -0
- package/src/components/iframe/index.ts +334 -0
- package/src/components/iframe/types/index.ts +139 -0
- package/src/components/loading/config.ts +29 -0
- package/src/components/loading/index.css +66 -0
- package/src/components/loading/index.ts +99 -0
- package/src/components/loading/types/index.ts +34 -0
- package/src/components/panel/config.ts +519 -0
- package/src/components/panel/handlerComponents.ts +2900 -0
- package/src/components/panel/index.css +1222 -0
- package/src/components/panel/index.ts +207 -0
- package/src/components/panel/types/components-button.ts +68 -0
- package/src/components/panel/types/components-common.ts +50 -0
- package/src/components/panel/types/components-deepMenu.ts +84 -0
- package/src/components/panel/types/components-forms.ts +44 -0
- package/src/components/panel/types/components-input.ts +78 -0
- package/src/components/panel/types/components-own.ts +30 -0
- package/src/components/panel/types/components-select.ts +93 -0
- package/src/components/panel/types/components-selectMultiple.ts +130 -0
- package/src/components/panel/types/components-slider.ts +77 -0
- package/src/components/panel/types/components-switch.ts +56 -0
- package/src/components/panel/types/components-textarea.ts +68 -0
- package/src/components/panel/types/index.ts +177 -0
- package/src/components/prompt/config.ts +94 -0
- package/src/components/prompt/index.css +34 -0
- package/src/components/prompt/index.ts +216 -0
- package/src/components/prompt/types/index.ts +55 -0
- package/src/components/rightClickMenu/config.ts +98 -0
- package/src/components/rightClickMenu/index.css +112 -0
- package/src/components/rightClickMenu/index.ts +602 -0
- package/src/components/rightClickMenu/types/index.ts +97 -0
- package/src/components/searchSuggestion/config.ts +56 -0
- package/src/components/searchSuggestion/index.ts +856 -0
- package/src/components/searchSuggestion/types/index.ts +239 -0
- package/src/components/tooltip/config.ts +34 -0
- package/src/components/tooltip/index.css +199 -0
- package/src/components/tooltip/index.ts +604 -0
- package/src/components/tooltip/types/index.ts +117 -0
- package/src/config/CommonCSSClassName.ts +17 -0
- package/src/config/GlobalConfig.ts +63 -0
- package/src/css/animation.css +987 -0
- package/src/css/button.css +551 -0
- package/src/css/common.css +48 -0
- package/src/css/index.css +253 -0
- package/src/css/ninePalaceGridPosition.css +50 -0
- package/src/css/scrollbar.css +22 -0
- package/src/handler/PopsElementHandler.ts +304 -0
- package/src/handler/PopsHandler.ts +589 -0
- package/src/svg/arrowLeft.svg +4 -0
- package/src/svg/arrowRight.svg +4 -0
- package/src/svg/chromeFilled.svg +11 -0
- package/src/svg/circleClose.svg +8 -0
- package/src/svg/close.svg +5 -0
- package/src/svg/cpu.svg +8 -0
- package/src/svg/delete.svg +5 -0
- package/src/svg/documentCopy.svg +5 -0
- package/src/svg/edit.svg +8 -0
- package/src/svg/eleme.svg +5 -0
- package/src/svg/elemePlus.svg +5 -0
- package/src/svg/headset.svg +5 -0
- package/src/svg/hide.svg +8 -0
- package/src/svg/keyboard.svg +8 -0
- package/src/svg/loading.svg +5 -0
- package/src/svg/max.svg +5 -0
- package/src/svg/min.svg +5 -0
- package/src/svg/mise.svg +5 -0
- package/src/svg/monitor.svg +5 -0
- package/src/svg/next.svg +5 -0
- package/src/svg/picture.svg +8 -0
- package/src/svg/prev.svg +5 -0
- package/src/svg/search.svg +5 -0
- package/src/svg/share.svg +5 -0
- package/src/svg/upload.svg +5 -0
- package/src/svg/videoPause.svg +5 -0
- package/src/svg/videoPlay.svg +5 -0
- package/src/svg/view.svg +5 -0
- package/src/types/PopsDOMUtilsEventType.d.ts +252 -0
- package/src/types/animation.d.ts +19 -0
- package/src/types/button.d.ts +187 -0
- package/src/types/components.d.ts +210 -0
- package/src/types/event.d.ts +63 -0
- package/src/types/global.d.ts +25 -0
- package/src/types/icon.d.ts +32 -0
- package/src/types/inst.d.ts +24 -0
- package/src/types/main.d.ts +111 -0
- package/src/types/mask.d.ts +49 -0
- package/src/types/position.d.ts +60 -0
- package/src/utils/PopsDOMUtils.ts +2408 -0
- package/src/utils/PopsDOMUtilsEventsConfig.ts +4 -0
- package/src/utils/PopsInstanceUtils.ts +688 -0
- package/src/utils/PopsMathUtils.ts +71 -0
- package/src/utils/PopsSafeUtils.ts +22 -0
- package/src/utils/PopsUtils.ts +406 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import type { PopsCommonConfig } from "../../../types/components";
|
|
2
|
+
|
|
3
|
+
export type PopsSearchSuggestionData<T = any> = {
|
|
4
|
+
/**
|
|
5
|
+
* 值
|
|
6
|
+
*/
|
|
7
|
+
value: T;
|
|
8
|
+
/**
|
|
9
|
+
* 是否启用右侧的删除按钮
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
enableDeleteButton?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 删除按钮的点击回调
|
|
15
|
+
* @returns
|
|
16
|
+
*
|
|
17
|
+
* + true 移除该元素并且从data中移除该数据, 如果data是函数返回数组的话,那么不会生效
|
|
18
|
+
*/
|
|
19
|
+
deleteButtonClickCallback?: (
|
|
20
|
+
/**
|
|
21
|
+
* 点击事件
|
|
22
|
+
*/
|
|
23
|
+
event: MouseEvent | PointerEvent,
|
|
24
|
+
/**
|
|
25
|
+
* 当前项的元素
|
|
26
|
+
*/
|
|
27
|
+
$dataItem: HTMLLIElement,
|
|
28
|
+
/**
|
|
29
|
+
* 数据项
|
|
30
|
+
*/
|
|
31
|
+
dataItem: PopsSearchSuggestionData<T>,
|
|
32
|
+
/**
|
|
33
|
+
* 当前配置
|
|
34
|
+
*/
|
|
35
|
+
config: PopsSearchSuggestionDetails<T>
|
|
36
|
+
) => void | boolean | Promise<void | boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* 获取每一项的html,在显示的时候会调用该函数
|
|
39
|
+
*
|
|
40
|
+
* 它的父元素是一个\<li>元素
|
|
41
|
+
*/
|
|
42
|
+
itemView: (
|
|
43
|
+
/**
|
|
44
|
+
* 数据项
|
|
45
|
+
*/
|
|
46
|
+
dateItem: PopsSearchSuggestionData<T>,
|
|
47
|
+
/**
|
|
48
|
+
* 父元素\<li>
|
|
49
|
+
*/
|
|
50
|
+
$parent: HTMLLIElement,
|
|
51
|
+
/**
|
|
52
|
+
* 当前配置
|
|
53
|
+
*/
|
|
54
|
+
config: PopsSearchSuggestionDetails<T>
|
|
55
|
+
) => HTMLElement | string;
|
|
56
|
+
/**
|
|
57
|
+
* 每一项的点击回调
|
|
58
|
+
* @returns
|
|
59
|
+
*
|
|
60
|
+
* + true 如果设置了inputTarget且类型是input或textarea的话,那么将自动设置目标值为当前点击项的value值
|
|
61
|
+
*/
|
|
62
|
+
clickCallback?: (
|
|
63
|
+
/**
|
|
64
|
+
* 点击事件
|
|
65
|
+
*/
|
|
66
|
+
event: MouseEvent | PointerEvent,
|
|
67
|
+
/**
|
|
68
|
+
* 当前项的元素
|
|
69
|
+
*/
|
|
70
|
+
$dataItem: HTMLLIElement,
|
|
71
|
+
/**
|
|
72
|
+
* 数据项
|
|
73
|
+
*/
|
|
74
|
+
dataItem: PopsSearchSuggestionData<T>,
|
|
75
|
+
/**
|
|
76
|
+
* 当前配置
|
|
77
|
+
*/
|
|
78
|
+
config: PopsSearchSuggestionDetails<T>
|
|
79
|
+
) => void | boolean | Promise<void | boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* 键盘的上下键选择的回调
|
|
82
|
+
*/
|
|
83
|
+
selectCallback?: (
|
|
84
|
+
/**
|
|
85
|
+
* 键盘事件
|
|
86
|
+
*/
|
|
87
|
+
event: KeyboardEvent,
|
|
88
|
+
/**
|
|
89
|
+
* 当前项的元素
|
|
90
|
+
*/
|
|
91
|
+
$dataItem: HTMLLIElement,
|
|
92
|
+
/**
|
|
93
|
+
* 数据项
|
|
94
|
+
*/
|
|
95
|
+
dataItem: PopsSearchSuggestionData<T>,
|
|
96
|
+
/**
|
|
97
|
+
* 当前配置
|
|
98
|
+
*/
|
|
99
|
+
config: PopsSearchSuggestionDetails<T>
|
|
100
|
+
) => void;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* 搜索建议悬浮窗
|
|
104
|
+
* pops.searchSuggestion
|
|
105
|
+
*/
|
|
106
|
+
export interface PopsSearchSuggestionDetails<T = any>
|
|
107
|
+
extends Pick<PopsCommonConfig, "useShadowRoot" | "zIndex" | "style"> {
|
|
108
|
+
/**
|
|
109
|
+
* 当前的环境,可以是document,可以是shadowroot,默认是document
|
|
110
|
+
* @default document
|
|
111
|
+
*/
|
|
112
|
+
selfDocument?: Document | ShadowRoot | (Document | ShadowRoot)[];
|
|
113
|
+
/**
|
|
114
|
+
* 目标元素,一般是跟随它的位置变化,监听它的focus/click
|
|
115
|
+
*/
|
|
116
|
+
target: HTMLElement;
|
|
117
|
+
/**
|
|
118
|
+
* 目标input元素,监听它的focus/click/input事件
|
|
119
|
+
*
|
|
120
|
+
* 如果未填,那么自动使用target的值
|
|
121
|
+
* @default config.target
|
|
122
|
+
*/
|
|
123
|
+
inputTarget?: HTMLInputElement | HTMLTextAreaElement;
|
|
124
|
+
/**
|
|
125
|
+
* 数据
|
|
126
|
+
*/
|
|
127
|
+
data: PopsSearchSuggestionData<T>[] | (() => PopsSearchSuggestionData<T>[]);
|
|
128
|
+
/**
|
|
129
|
+
* 自定义的className
|
|
130
|
+
* @default ""
|
|
131
|
+
*/
|
|
132
|
+
className?: string;
|
|
133
|
+
/**
|
|
134
|
+
* 建议框的position位置
|
|
135
|
+
*
|
|
136
|
+
* + `true`:absolute
|
|
137
|
+
* + `false`:relative
|
|
138
|
+
* @default true
|
|
139
|
+
*/
|
|
140
|
+
isAbsolute?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* 是否启用动画
|
|
143
|
+
* @default false
|
|
144
|
+
*/
|
|
145
|
+
isAnimation?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 是否启用折叠动画
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
useFoldAnimation?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* 是否启用箭头
|
|
153
|
+
* @default false
|
|
154
|
+
*/
|
|
155
|
+
useArrow?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* 建议框的宽度
|
|
158
|
+
* @default "250px"
|
|
159
|
+
*/
|
|
160
|
+
width?: string;
|
|
161
|
+
/**
|
|
162
|
+
* 是否和config.target的宽度同步
|
|
163
|
+
* @default true
|
|
164
|
+
*/
|
|
165
|
+
followTargetWidth?: true;
|
|
166
|
+
/**
|
|
167
|
+
* 建议框的最大高度
|
|
168
|
+
* @default "300px"
|
|
169
|
+
*/
|
|
170
|
+
maxHeight?: string;
|
|
171
|
+
/**
|
|
172
|
+
* 建议框距离元素的距离
|
|
173
|
+
* @default 0
|
|
174
|
+
*/
|
|
175
|
+
topDistance?: number;
|
|
176
|
+
/**
|
|
177
|
+
* 建议框显示的位置,默认是auto(自动判断位置)
|
|
178
|
+
* @default "auto"
|
|
179
|
+
*/
|
|
180
|
+
position?: "top" | "bottom" | "auto";
|
|
181
|
+
/**
|
|
182
|
+
* 当位置在上面时(包括auto自动判断在上面时),是否对搜索项进行反转
|
|
183
|
+
* @default true
|
|
184
|
+
*/
|
|
185
|
+
positionTopToReverse?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* 搜索中的提示,可以是html
|
|
188
|
+
*
|
|
189
|
+
* 前提:inputTarget是input/textarea
|
|
190
|
+
*
|
|
191
|
+
* 触发change事件,且没有搜索到数据,则显示此提示
|
|
192
|
+
*/
|
|
193
|
+
searchingTip?: string;
|
|
194
|
+
/**
|
|
195
|
+
* 没有搜索结果的提示的html
|
|
196
|
+
*
|
|
197
|
+
* 前提:inputTarget是input/textarea
|
|
198
|
+
*
|
|
199
|
+
* 触发change事件,且没有搜索到数据,则显示此结果项
|
|
200
|
+
*
|
|
201
|
+
* 如果该值是函数,需要返回的\<li>元素属性上存在data-none="true"
|
|
202
|
+
* @example
|
|
203
|
+
* <li data-none="true">暂无结果</li>
|
|
204
|
+
*/
|
|
205
|
+
toSearhNotResultHTML?: string | (() => HTMLLIElement);
|
|
206
|
+
/**
|
|
207
|
+
* 当没有搜索结果时,是否隐藏建议框
|
|
208
|
+
* @default false
|
|
209
|
+
*/
|
|
210
|
+
toHideWithNotResult?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* 跟随目标的位置
|
|
213
|
+
*
|
|
214
|
+
* + `target`:跟随config.target的位置
|
|
215
|
+
* + `input`:跟随config.inputTarget的位置
|
|
216
|
+
* + `inputCursor`:跟随config.inputTarget的输入框光标位置
|
|
217
|
+
*
|
|
218
|
+
* @default "target"
|
|
219
|
+
*/
|
|
220
|
+
followPosition?: "target" | "input" | "inputCursor";
|
|
221
|
+
/**
|
|
222
|
+
* 当config.target触发input时自动调用该函数来获取数据
|
|
223
|
+
* @returns 返回是需要显示的数据
|
|
224
|
+
*/
|
|
225
|
+
inputTargetChangeRefreshShowDataCallback?: (
|
|
226
|
+
/**
|
|
227
|
+
* 当前输入框的值
|
|
228
|
+
*/
|
|
229
|
+
inputValue: string,
|
|
230
|
+
/**
|
|
231
|
+
* config.data的数据
|
|
232
|
+
*/
|
|
233
|
+
data: PopsSearchSuggestionData<T>[],
|
|
234
|
+
/**
|
|
235
|
+
* 当前配置
|
|
236
|
+
*/
|
|
237
|
+
config: PopsSearchSuggestionDetails<T>
|
|
238
|
+
) => Promise<PopsSearchSuggestionData<T>[]> | PopsSearchSuggestionData<T>[];
|
|
239
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PopsToolTipDetails } from "./types/index";
|
|
2
|
+
|
|
3
|
+
export const PopsTooltipConfig = (): DeepRequired<PopsToolTipDetails> => {
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
return {
|
|
6
|
+
useShadowRoot: true,
|
|
7
|
+
target: null as any,
|
|
8
|
+
content: "默认文字",
|
|
9
|
+
isDiffContent: false,
|
|
10
|
+
position: "top",
|
|
11
|
+
className: "",
|
|
12
|
+
isFixed: false,
|
|
13
|
+
alwaysShow: false,
|
|
14
|
+
triggerShowEventName: "mouseenter touchstart",
|
|
15
|
+
triggerCloseEventName: "mouseleave touchend",
|
|
16
|
+
zIndex: 10000,
|
|
17
|
+
only: false,
|
|
18
|
+
eventOption: {
|
|
19
|
+
passive: false,
|
|
20
|
+
capture: true,
|
|
21
|
+
once: false,
|
|
22
|
+
},
|
|
23
|
+
showBeforeCallBack() {},
|
|
24
|
+
showAfterCallBack() {},
|
|
25
|
+
closeBeforeCallBack() {},
|
|
26
|
+
closeAfterCallBack() {},
|
|
27
|
+
delayCloseTime: 100,
|
|
28
|
+
showArrow: true,
|
|
29
|
+
arrowDistance: 12.5,
|
|
30
|
+
otherDistance: 0,
|
|
31
|
+
style: "",
|
|
32
|
+
beforeAppendToPageCallBack() {},
|
|
33
|
+
} as Required<PopsToolTipDetails>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
.pops-tip {
|
|
2
|
+
--pops-bg-opacity: 1;
|
|
3
|
+
--tooltip-color: #4e4e4e;
|
|
4
|
+
--tooltip-bg-color: rgb(255, 255, 255, var(--pops-bg-opacity));
|
|
5
|
+
--tooltip-bd-radius: 2px;
|
|
6
|
+
--tooltip-box-shadow-left-color: rgba(0, 0, 0, 0.24);
|
|
7
|
+
--tooltip-box-shadow-right-color: rgba(0, 0, 0, 0.12);
|
|
8
|
+
--tooltip-font-size: 14px;
|
|
9
|
+
--tooltip-padding-top: 13px;
|
|
10
|
+
--tooltip-padding-right: 13px;
|
|
11
|
+
--tooltip-padding-bottom: 13px;
|
|
12
|
+
--tooltip-padding-left: 13px;
|
|
13
|
+
|
|
14
|
+
--tooltip-arrow-box-shadow-left-color: rgba(0, 0, 0, 0.24);
|
|
15
|
+
--tooltip-arrow-box-shadow-right-color: rgba(0, 0, 0, 0.12);
|
|
16
|
+
--tooltip-arrow--after-color: rgb(78, 78, 78);
|
|
17
|
+
--tooltip-arrow--after-bg-color: rgb(255, 255, 255, var(--pops-bg-opacity));
|
|
18
|
+
--tooltip-arrow--after-width: 12px;
|
|
19
|
+
--tooltip-arrow--after-height: 12px;
|
|
20
|
+
}
|
|
21
|
+
.pops-tip {
|
|
22
|
+
padding: var(--tooltip-padding-top) var(--tooltip-padding-right) var(--tooltip-padding-bottom)
|
|
23
|
+
var(--tooltip-padding-left);
|
|
24
|
+
max-width: 400px;
|
|
25
|
+
max-height: 300px;
|
|
26
|
+
border-radius: var(--tooltip-bd-radius);
|
|
27
|
+
background-color: var(--tooltip-bg-color);
|
|
28
|
+
box-shadow:
|
|
29
|
+
0 1.5px 4px var(--tooltip-box-shadow-left-color),
|
|
30
|
+
0 1.5px 6px var(--tooltip-box-shadow-right-color);
|
|
31
|
+
color: var(--tooltip-color);
|
|
32
|
+
font-size: var(--tooltip-font-size);
|
|
33
|
+
}
|
|
34
|
+
.pops-tip[data-position="absolute"] {
|
|
35
|
+
position: absolute;
|
|
36
|
+
}
|
|
37
|
+
.pops-tip[data-position="fixed"] {
|
|
38
|
+
position: fixed;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pops-tip .pops-tip-arrow {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 100%;
|
|
44
|
+
left: 50%;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 12.5px;
|
|
48
|
+
transform: translateX(-50%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pops-tip .pops-tip-arrow::after {
|
|
52
|
+
position: absolute;
|
|
53
|
+
top: 0;
|
|
54
|
+
left: 50%;
|
|
55
|
+
width: var(--tooltip-arrow--after-width);
|
|
56
|
+
height: var(--tooltip-arrow--after-height);
|
|
57
|
+
background: var(--tooltip-arrow--after-bg-color);
|
|
58
|
+
color: var(--tooltip-arrow--after-color);
|
|
59
|
+
box-shadow:
|
|
60
|
+
0 1px 7px var(--tooltip-arrow-box-shadow-left-color),
|
|
61
|
+
0 1px 7px var(--tooltip-arrow-box-shadow-right-color);
|
|
62
|
+
content: "";
|
|
63
|
+
transform: translateX(-50%) translateY(-50%) rotate(45deg);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pops-tip .pops-tip-arrow[data-position="bottom"] {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 100%;
|
|
69
|
+
left: 50%;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 12.5px;
|
|
73
|
+
transform: translateX(-50%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pops-tip .pops-tip-arrow[data-position="bottom"]:after {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 50%;
|
|
80
|
+
width: var(--tooltip-arrow--after-width);
|
|
81
|
+
height: var(--tooltip-arrow--after-height);
|
|
82
|
+
background: var(--tooltip-arrow--after-bg-color);
|
|
83
|
+
box-shadow:
|
|
84
|
+
0 1px 7px var(--tooltip-arrow-box-shadow-left-color),
|
|
85
|
+
0 1px 7px var(--tooltip-arrow-box-shadow-right-color);
|
|
86
|
+
content: "";
|
|
87
|
+
transform: translateX(-50%) translateY(-50%) rotate(45deg);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.pops-tip .pops-tip-arrow[data-position="left"] {
|
|
91
|
+
top: 50%;
|
|
92
|
+
left: -12.5px;
|
|
93
|
+
width: 12.5px;
|
|
94
|
+
height: 50px;
|
|
95
|
+
transform: translateY(-50%);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.pops-tip .pops-tip-arrow[data-position="left"]:after {
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 50%;
|
|
101
|
+
left: 100%;
|
|
102
|
+
content: "";
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.pops-tip .pops-tip-arrow[data-position="right"] {
|
|
106
|
+
top: 50%;
|
|
107
|
+
right: -12.5px;
|
|
108
|
+
left: auto;
|
|
109
|
+
width: 12.5px;
|
|
110
|
+
height: 50px;
|
|
111
|
+
transform: translateY(-50%);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.pops-tip .pops-tip-arrow[data-position="right"]:after {
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: 50%;
|
|
117
|
+
left: 0;
|
|
118
|
+
content: "";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pops-tip .pops-tip-arrow[data-position="top"] {
|
|
122
|
+
top: -12.5px;
|
|
123
|
+
left: 50%;
|
|
124
|
+
transform: translateX(-50%);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.pops-tip .pops-tip-arrow[data-position="top"]:after {
|
|
128
|
+
position: absolute;
|
|
129
|
+
top: 100%;
|
|
130
|
+
left: 50%;
|
|
131
|
+
content: "";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.pops-tip[data-motion] {
|
|
135
|
+
-webkit-animation-duration: 0.25s;
|
|
136
|
+
animation-duration: 0.25s;
|
|
137
|
+
-webkit-animation-fill-mode: forwards;
|
|
138
|
+
animation-fill-mode: forwards;
|
|
139
|
+
}
|
|
140
|
+
.pops-tip[data-motion="fadeOutRight"] {
|
|
141
|
+
-webkit-animation-name: pops-motion-fadeOutRight;
|
|
142
|
+
animation-name: pops-motion-fadeOutRight;
|
|
143
|
+
}
|
|
144
|
+
.pops-tip[data-motion="fadeInTop"] {
|
|
145
|
+
-webkit-animation-name: pops-motion-fadeInTop;
|
|
146
|
+
animation-name: pops-motion-fadeInTop;
|
|
147
|
+
animation-timing-function: cubic-bezier(0.49, 0.49, 0.13, 1.3);
|
|
148
|
+
}
|
|
149
|
+
.pops-tip[data-motion="fadeOutTop"] {
|
|
150
|
+
-webkit-animation-name: pops-motion-fadeOutTop;
|
|
151
|
+
animation-name: pops-motion-fadeOutTop;
|
|
152
|
+
animation-timing-function: cubic-bezier(0.32, 0.37, 0.06, 0.87);
|
|
153
|
+
}
|
|
154
|
+
.pops-tip[data-motion="fadeInBottom"] {
|
|
155
|
+
-webkit-animation-name: pops-motion-fadeInBottom;
|
|
156
|
+
animation-name: pops-motion-fadeInBottom;
|
|
157
|
+
}
|
|
158
|
+
.pops-tip[data-motion="fadeOutBottom"] {
|
|
159
|
+
-webkit-animation-name: pops-motion-fadeOutBottom;
|
|
160
|
+
animation-name: pops-motion-fadeOutBottom;
|
|
161
|
+
}
|
|
162
|
+
.pops-tip[data-motion="fadeInLeft"] {
|
|
163
|
+
-webkit-animation-name: pops-motion-fadeInLeft;
|
|
164
|
+
animation-name: pops-motion-fadeInLeft;
|
|
165
|
+
}
|
|
166
|
+
.pops-tip[data-motion="fadeOutLeft"] {
|
|
167
|
+
-webkit-animation-name: pops-motion-fadeOutLeft;
|
|
168
|
+
animation-name: pops-motion-fadeOutLeft;
|
|
169
|
+
}
|
|
170
|
+
.pops-tip[data-motion="fadeInRight"] {
|
|
171
|
+
-webkit-animation-name: pops-motion-fadeInRight;
|
|
172
|
+
animation-name: pops-motion-fadeInRight;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* github的样式 */
|
|
176
|
+
.pops-tip.github-tooltip {
|
|
177
|
+
--tooltip-bg-opacity: 1;
|
|
178
|
+
--tooltip-color: #ffffff;
|
|
179
|
+
--tooltip-bg-color: rgb(36, 41, 47, var(--tooltip-bg-opacity));
|
|
180
|
+
--tooltip-bd-radius: 6px;
|
|
181
|
+
--tooltip-padding-top: 6px;
|
|
182
|
+
--tooltip-padding-right: 8px;
|
|
183
|
+
--tooltip-padding-bottom: 6px;
|
|
184
|
+
--tooltip-padding-left: 8px;
|
|
185
|
+
|
|
186
|
+
--tooltip-arrow--after-color: rgb(255, 255, 255);
|
|
187
|
+
--tooltip-arrow--after-bg-color: rgb(36, 41, 47, var(--tooltip-bg-opacity));
|
|
188
|
+
--tooltip-arrow--after-width: 8px;
|
|
189
|
+
--tooltip-arrow--after-height: 8px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (prefers-color-scheme: dark) {
|
|
193
|
+
.pops-tip {
|
|
194
|
+
--tooltip-color: #ffffff;
|
|
195
|
+
--tooltip-bg-color: #fafafa;
|
|
196
|
+
--tooltip-arrow--after-color: #fafafa;
|
|
197
|
+
--tooltip-arrow--after-bg-color: rgb(250, 250, 250, var(--pops-bg-opacity));
|
|
198
|
+
}
|
|
199
|
+
}
|