@whitesev/pops 2.6.0 → 3.0.0
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 +1233 -1092
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +1233 -1092
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +1233 -1092
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +1233 -1092
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +1233 -1092
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +1233 -1092
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/eslint.config.d.mts +2 -0
- package/dist/types/src/Pops.d.ts +98 -103
- package/dist/types/src/PopsInst.d.ts +2 -2
- package/dist/types/src/components/alert/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/alert/index.d.ts +2 -2
- package/dist/types/src/components/alert/types/index.d.ts +4 -4
- package/dist/types/src/components/confirm/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/confirm/index.d.ts +2 -2
- package/dist/types/src/components/confirm/types/index.d.ts +2 -2
- package/dist/types/src/components/drawer/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/drawer/index.d.ts +2 -2
- package/dist/types/src/components/drawer/types/index.d.ts +2 -2
- package/dist/types/src/components/folder/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/folder/index.d.ts +2 -2
- package/dist/types/src/components/folder/types/index.d.ts +31 -7
- package/dist/types/src/components/iframe/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/iframe/index.d.ts +2 -5
- package/dist/types/src/components/iframe/types/index.d.ts +13 -42
- package/dist/types/src/components/loading/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/loading/index.d.ts +2 -2
- package/dist/types/src/components/loading/types/index.d.ts +4 -4
- package/dist/types/src/components/panel/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/panel/handlerComponents.d.ts +47 -43
- package/dist/types/src/components/panel/index.d.ts +3 -3
- package/dist/types/src/components/panel/types/components-button.d.ts +7 -6
- package/dist/types/src/components/panel/types/components-common.d.ts +7 -7
- package/dist/types/src/components/panel/types/components-container.d.ts +24 -0
- package/dist/types/src/components/panel/types/components-deepMenu.d.ts +13 -13
- package/dist/types/src/components/panel/types/components-input.d.ts +6 -6
- package/dist/types/src/components/panel/types/components-own.d.ts +2 -2
- package/dist/types/src/components/panel/types/components-select.d.ts +9 -9
- package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +8 -8
- package/dist/types/src/components/panel/types/components-slider.d.ts +7 -7
- package/dist/types/src/components/panel/types/components-switch.d.ts +6 -6
- package/dist/types/src/components/panel/types/components-textarea.d.ts +6 -6
- package/dist/types/src/components/panel/types/index.d.ts +36 -28
- package/dist/types/src/components/prompt/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/prompt/index.d.ts +2 -2
- package/dist/types/src/components/prompt/types/index.d.ts +4 -3
- package/dist/types/src/components/rightClickMenu/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/rightClickMenu/index.d.ts +29 -27
- package/dist/types/src/components/rightClickMenu/types/index.d.ts +32 -11
- package/dist/types/src/components/searchSuggestion/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/searchSuggestion/index.d.ts +21 -6
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +15 -13
- package/dist/types/src/components/tooltip/defaultConfig.d.ts +2 -0
- package/dist/types/src/components/tooltip/index.d.ts +6 -21
- package/dist/types/src/components/tooltip/types/index.d.ts +8 -6
- package/dist/types/src/config/GlobalConfig.d.ts +3 -3
- package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
- package/dist/types/src/handler/PopsHandler.d.ts +18 -18
- package/dist/types/src/types/button.d.ts +4 -97
- package/dist/types/src/types/components.d.ts +8 -8
- package/dist/types/src/types/event.d.ts +0 -30
- package/dist/types/src/types/global.d.ts +2 -0
- package/dist/types/src/types/inst.d.ts +5 -5
- package/dist/types/src/types/main.d.ts +35 -80
- package/dist/types/src/types/mask.d.ts +18 -15
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +15 -15
- package/dist/types/src/utils/PopsUtils.d.ts +4 -0
- package/package.json +10 -10
- package/src/Pops.ts +44 -44
- package/src/PopsAnimation.ts +1 -1
- package/src/PopsInst.ts +2 -2
- package/src/components/alert/{config.ts → defaultConfig.ts} +7 -7
- package/src/components/alert/index.ts +16 -18
- package/src/components/alert/types/index.ts +4 -4
- package/src/components/confirm/{config.ts → defaultConfig.ts} +11 -11
- package/src/components/confirm/index.ts +11 -13
- package/src/components/confirm/types/index.ts +3 -3
- package/src/components/drawer/{config.ts → defaultConfig.ts} +10 -10
- package/src/components/drawer/index.ts +18 -17
- package/src/components/drawer/types/index.ts +3 -3
- package/src/components/folder/{config.ts → defaultConfig.ts} +22 -18
- package/src/components/folder/index.ts +61 -60
- package/src/components/folder/types/index.ts +31 -18
- package/src/components/iframe/{config.ts → defaultConfig.ts} +2 -2
- package/src/components/iframe/index.ts +24 -29
- package/src/components/iframe/types/index.ts +13 -56
- package/src/components/loading/{config.ts → defaultConfig.ts} +3 -3
- package/src/components/loading/index.ts +13 -11
- package/src/components/loading/types/index.ts +5 -5
- package/src/components/panel/{config.ts → defaultConfig.ts} +115 -37
- package/src/components/panel/handlerComponents.ts +446 -428
- package/src/components/panel/index.css +11 -3
- package/src/components/panel/index.ts +15 -28
- package/src/components/panel/types/components-button.ts +7 -6
- package/src/components/panel/types/components-common.ts +7 -7
- package/src/components/panel/types/components-container.ts +25 -0
- package/src/components/panel/types/components-deepMenu.ts +13 -13
- package/src/components/panel/types/components-input.ts +6 -6
- package/src/components/panel/types/components-own.ts +2 -2
- package/src/components/panel/types/components-select.ts +11 -11
- package/src/components/panel/types/components-selectMultiple.ts +8 -9
- package/src/components/panel/types/components-slider.ts +7 -7
- package/src/components/panel/types/components-switch.ts +6 -6
- package/src/components/panel/types/components-textarea.ts +6 -6
- package/src/components/panel/types/index.ts +45 -38
- package/src/components/prompt/{config.ts → defaultConfig.ts} +10 -10
- package/src/components/prompt/index.ts +13 -15
- package/src/components/prompt/types/index.ts +4 -3
- package/src/components/rightClickMenu/{config.ts → defaultConfig.ts} +20 -19
- package/src/components/rightClickMenu/index.ts +125 -108
- package/src/components/rightClickMenu/types/index.ts +36 -14
- package/src/components/searchSuggestion/{config.ts → defaultConfig.ts} +18 -11
- package/src/components/searchSuggestion/index.ts +116 -96
- package/src/components/searchSuggestion/types/index.ts +17 -15
- package/src/components/tooltip/{config.ts → defaultConfig.ts} +5 -6
- package/src/components/tooltip/index.ts +21 -21
- package/src/components/tooltip/types/index.ts +9 -7
- package/src/config/GlobalConfig.ts +2 -2
- package/src/css/common.css +6 -0
- package/src/handler/PopsElementHandler.ts +29 -30
- package/src/handler/PopsHandler.ts +43 -43
- package/src/svg/cpu.svg +7 -7
- package/src/svg/delete.svg +4 -4
- package/src/svg/documentCopy.svg +4 -4
- package/src/svg/edit.svg +7 -7
- package/src/svg/eleme.svg +4 -4
- package/src/svg/elemePlus.svg +4 -4
- package/src/svg/headset.svg +4 -4
- package/src/svg/hide.svg +7 -7
- package/src/svg/keyboard.svg +7 -7
- package/src/svg/loading.svg +4 -4
- package/src/svg/max.svg +4 -4
- package/src/svg/min.svg +2 -4
- package/src/svg/mise.svg +4 -4
- package/src/svg/monitor.svg +4 -4
- package/src/svg/next.svg +4 -4
- package/src/svg/picture.svg +7 -7
- package/src/svg/prev.svg +4 -4
- package/src/svg/search.svg +4 -4
- package/src/svg/share.svg +4 -4
- package/src/svg/upload.svg +4 -4
- package/src/svg/videoPause.svg +4 -4
- package/src/svg/videoPlay.svg +4 -4
- package/src/svg/view.svg +4 -4
- package/src/types/button.d.ts +4 -97
- package/src/types/components.d.ts +8 -8
- package/src/types/event.d.ts +0 -30
- package/src/types/global.d.ts +2 -0
- package/src/types/inst.d.ts +5 -5
- package/src/types/main.d.ts +35 -80
- package/src/types/mask.d.ts +18 -15
- package/src/utils/PopsDOMUtils.ts +34 -34
- package/src/utils/PopsInstanceUtils.ts +129 -139
- package/src/utils/PopsUtils.ts +60 -45
- package/dist/types/src/components/alert/config.d.ts +0 -2
- package/dist/types/src/components/confirm/config.d.ts +0 -2
- package/dist/types/src/components/drawer/config.d.ts +0 -2
- package/dist/types/src/components/folder/config.d.ts +0 -2
- package/dist/types/src/components/iframe/config.d.ts +0 -2
- package/dist/types/src/components/loading/config.d.ts +0 -2
- package/dist/types/src/components/panel/config.d.ts +0 -2
- package/dist/types/src/components/panel/types/components-forms.d.ts +0 -23
- package/dist/types/src/components/prompt/config.d.ts +0 -2
- package/dist/types/src/components/rightClickMenu/config.d.ts +0 -2
- package/dist/types/src/components/searchSuggestion/config.d.ts +0 -2
- package/dist/types/src/components/tooltip/config.d.ts +0 -2
- package/src/components/panel/types/components-forms.ts +0 -24
|
@@ -4,28 +4,29 @@ import { PopsHandler } from "../../handler/PopsHandler";
|
|
|
4
4
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
5
5
|
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
6
6
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
7
|
-
import {
|
|
8
|
-
import type {
|
|
7
|
+
import { PopsRightClickMenuDefaultConfig } from "./defaultConfig";
|
|
8
|
+
import type {
|
|
9
|
+
PopsRightClickMenuChildRootStoreNodeValue,
|
|
10
|
+
PopsRightClickMenuConfig,
|
|
11
|
+
PopsRightClickMenuDataConfig,
|
|
12
|
+
PopsRightClickMenuItemStoreNodeValue,
|
|
13
|
+
PopsRightClickMenuRootStoreNodeValue,
|
|
14
|
+
} from "./types";
|
|
9
15
|
import { PopsCSS } from "../../PopsCSS";
|
|
10
16
|
import { PopsIcon } from "../../PopsIcon";
|
|
11
17
|
import type { PopsType } from "../../types/main";
|
|
12
18
|
|
|
13
19
|
export const PopsRightClickMenu = {
|
|
14
|
-
init(
|
|
20
|
+
init(__config__: PopsRightClickMenuConfig) {
|
|
15
21
|
const guid = popsUtils.getRandomGUID();
|
|
16
22
|
// 设置当前类型
|
|
17
23
|
const popsType: PopsType = "rightClickMenu";
|
|
18
24
|
|
|
19
|
-
let config =
|
|
25
|
+
let config = PopsRightClickMenuDefaultConfig();
|
|
20
26
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
21
|
-
config = popsUtils.assign(config,
|
|
27
|
+
config = popsUtils.assign(config, __config__);
|
|
22
28
|
config = PopsHandler.handleOnly(popsType, config);
|
|
23
|
-
|
|
24
|
-
throw new Error("config.target 不能为空");
|
|
25
|
-
}
|
|
26
|
-
if (details.data) {
|
|
27
|
-
Reflect.set(config, "data", details.data);
|
|
28
|
-
}
|
|
29
|
+
|
|
29
30
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
30
31
|
PopsHandler.handleInit($shadowRoot, [
|
|
31
32
|
{
|
|
@@ -60,16 +61,18 @@ export const PopsRightClickMenu = {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
const PopsContextMenu = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
$data: {
|
|
65
|
+
menuDataKey: "data-menu",
|
|
66
|
+
},
|
|
67
|
+
$el: {
|
|
68
|
+
$root: null as any as HTMLElement,
|
|
69
|
+
},
|
|
67
70
|
/**
|
|
68
71
|
* 全局点击检测
|
|
69
72
|
* @param event
|
|
70
73
|
*/
|
|
71
74
|
windowCheckClickEvent(event: MouseEvent | PointerEvent) {
|
|
72
|
-
if (!PopsContextMenu
|
|
75
|
+
if (!PopsContextMenu.$el.$root) {
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
75
78
|
const $click = event.target as HTMLElement;
|
|
@@ -79,21 +82,21 @@ export const PopsRightClickMenu = {
|
|
|
79
82
|
if ($click.className && $click.className === "pops-shadow-container" && $click.shadowRoot != null) {
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
|
-
PopsContextMenu.closeAllMenu(PopsContextMenu
|
|
85
|
+
PopsContextMenu.closeAllMenu(PopsContextMenu.$el.$root);
|
|
83
86
|
},
|
|
84
87
|
/**
|
|
85
88
|
* target为shadowRoot或shadowRoot内的全局点击检测
|
|
86
89
|
* @param event
|
|
87
90
|
*/
|
|
88
91
|
shadowRootCheckClickEvent(event: MouseEvent | PointerEvent) {
|
|
89
|
-
if (!PopsContextMenu
|
|
92
|
+
if (!PopsContextMenu.$el.$root) {
|
|
90
93
|
return;
|
|
91
94
|
}
|
|
92
95
|
const $click = event.target as HTMLElement;
|
|
93
96
|
if ($click.closest(`.pops-${popsType}`)) {
|
|
94
97
|
return;
|
|
95
98
|
}
|
|
96
|
-
PopsContextMenu.closeAllMenu(PopsContextMenu
|
|
99
|
+
PopsContextMenu.closeAllMenu(PopsContextMenu.$el.$root);
|
|
97
100
|
},
|
|
98
101
|
/**
|
|
99
102
|
* 添加全局点击检测事件
|
|
@@ -102,8 +105,8 @@ export const PopsRightClickMenu = {
|
|
|
102
105
|
popsDOMUtils.on(globalThis, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
|
|
103
106
|
capture: true,
|
|
104
107
|
});
|
|
105
|
-
if (config
|
|
106
|
-
const $shadowRoot = config
|
|
108
|
+
if (config.$target instanceof Node) {
|
|
109
|
+
const $shadowRoot = config.$target.getRootNode();
|
|
107
110
|
if ($shadowRoot instanceof ShadowRoot) {
|
|
108
111
|
popsDOMUtils.on($shadowRoot, "click touchstart", void 0, PopsContextMenu.shadowRootCheckClickEvent, {
|
|
109
112
|
capture: true,
|
|
@@ -118,8 +121,8 @@ export const PopsRightClickMenu = {
|
|
|
118
121
|
popsDOMUtils.off(globalThis, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
|
|
119
122
|
capture: true,
|
|
120
123
|
});
|
|
121
|
-
if (config
|
|
122
|
-
const $shadowRoot = config
|
|
124
|
+
if (config.$target instanceof Node) {
|
|
125
|
+
const $shadowRoot = config.$target.getRootNode();
|
|
123
126
|
if ($shadowRoot instanceof ShadowRoot) {
|
|
124
127
|
popsDOMUtils.off($shadowRoot, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
|
|
125
128
|
capture: true,
|
|
@@ -132,26 +135,26 @@ export const PopsRightClickMenu = {
|
|
|
132
135
|
* @param event
|
|
133
136
|
* @param selectorTarget
|
|
134
137
|
*/
|
|
135
|
-
contextMenuEvent(event: PointerEvent, selectorTarget: NonNullable<
|
|
138
|
+
contextMenuEvent(event: PointerEvent, selectorTarget: NonNullable<PopsRightClickMenuConfig["$target"]>) {
|
|
136
139
|
if (config.preventDefault) {
|
|
137
140
|
popsDOMUtils.preventEvent(event);
|
|
138
141
|
}
|
|
139
142
|
PopsHandler.handleOnly(popsType, config);
|
|
140
|
-
if (PopsContextMenu
|
|
141
|
-
PopsContextMenu.closeAllMenu(PopsContextMenu
|
|
143
|
+
if (PopsContextMenu.$el.$root) {
|
|
144
|
+
PopsContextMenu.closeAllMenu(PopsContextMenu.$el.$root);
|
|
142
145
|
}
|
|
143
|
-
selectorTarget = selectorTarget ?? config
|
|
146
|
+
selectorTarget = selectorTarget ?? config.$target;
|
|
144
147
|
const rootElement = PopsContextMenu.showMenu(event, config.data, selectorTarget);
|
|
145
|
-
PopsContextMenu
|
|
148
|
+
PopsContextMenu.$el.$root = rootElement;
|
|
146
149
|
if (config.only) {
|
|
147
150
|
PopsHandler.handlePush(popsType, {
|
|
148
151
|
$shadowRoot: $shadowRoot,
|
|
149
152
|
$shadowContainer: $shadowContainer,
|
|
150
153
|
guid: guid,
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
$anim: rootElement,
|
|
155
|
+
$pops: rootElement,
|
|
153
156
|
beforeRemoveCallBack(instCommonConfig) {
|
|
154
|
-
PopsContextMenu.closeAllMenu(instCommonConfig
|
|
157
|
+
PopsContextMenu.closeAllMenu(instCommonConfig.$pops);
|
|
155
158
|
},
|
|
156
159
|
});
|
|
157
160
|
}
|
|
@@ -161,7 +164,7 @@ export const PopsRightClickMenu = {
|
|
|
161
164
|
* @param target 目标
|
|
162
165
|
* @param selector 子元素选择器
|
|
163
166
|
*/
|
|
164
|
-
addContextMenuEvent(target:
|
|
167
|
+
addContextMenuEvent(target: PopsRightClickMenuConfig["$target"], selector?: string) {
|
|
165
168
|
popsDOMUtils.on(target!, "contextmenu", selector, PopsContextMenu.contextMenuEvent);
|
|
166
169
|
},
|
|
167
170
|
/**
|
|
@@ -188,7 +191,7 @@ export const PopsRightClickMenu = {
|
|
|
188
191
|
$menu.remove();
|
|
189
192
|
};
|
|
190
193
|
if (popsDOMUtils.containsClassName($menu, `pops-${popsType}-anim-show`)) {
|
|
191
|
-
|
|
194
|
+
// 有动画
|
|
192
195
|
popsDOMUtils.on($menu, popsDOMUtils.getTransitionEndNameList(), transitionEndEvent, {
|
|
193
196
|
capture: true,
|
|
194
197
|
});
|
|
@@ -197,36 +200,37 @@ export const PopsRightClickMenu = {
|
|
|
197
200
|
popsDOMUtils.containsClassName($menu, `pops-${popsType}-anim-scale`) &&
|
|
198
201
|
popsDOMUtils.containsClassName($menu, `pops-${popsType}-anim-scale-open`)
|
|
199
202
|
) {
|
|
200
|
-
|
|
203
|
+
// 有动画
|
|
201
204
|
popsDOMUtils.on($menu, popsDOMUtils.getTransitionEndNameList(), transitionEndEvent, {
|
|
202
205
|
capture: true,
|
|
203
206
|
});
|
|
204
207
|
popsDOMUtils.removeClassName($menu, `pops-${popsType}-anim-scale-open`);
|
|
205
208
|
popsDOMUtils.addClassName($menu, `pops-${popsType}-anim-scale-not-open`);
|
|
206
209
|
} else {
|
|
207
|
-
|
|
210
|
+
// 无动画
|
|
208
211
|
$menu.remove();
|
|
209
212
|
}
|
|
210
213
|
},
|
|
211
214
|
/**
|
|
212
215
|
* 关闭所有菜单
|
|
213
|
-
* @param
|
|
216
|
+
* @param $root
|
|
214
217
|
*/
|
|
215
|
-
closeAllMenu(
|
|
216
|
-
if (
|
|
218
|
+
closeAllMenu($root: HTMLElement) {
|
|
219
|
+
if ($root == null) {
|
|
217
220
|
return;
|
|
218
221
|
}
|
|
219
|
-
const rootElementMenuData
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
const rootElementMenuData: PopsRightClickMenuRootStoreNodeValue | PopsRightClickMenuChildRootStoreNodeValue =
|
|
223
|
+
Reflect.get($root, PopsContextMenu.$data.menuDataKey);
|
|
224
|
+
if ((<PopsRightClickMenuChildRootStoreNodeValue>rootElementMenuData)?.root) {
|
|
225
|
+
$root = (<PopsRightClickMenuChildRootStoreNodeValue>rootElementMenuData).root;
|
|
222
226
|
}
|
|
223
227
|
|
|
224
|
-
const childMenuList = rootElementMenuData.child as HTMLElement[];
|
|
228
|
+
const childMenuList = (<PopsRightClickMenuRootStoreNodeValue>rootElementMenuData).child as HTMLElement[];
|
|
225
229
|
childMenuList.forEach((childMenuElement) => {
|
|
226
230
|
this.animationCloseMenu(childMenuElement);
|
|
227
231
|
});
|
|
228
|
-
this.animationCloseMenu(
|
|
229
|
-
PopsContextMenu
|
|
232
|
+
this.animationCloseMenu($root);
|
|
233
|
+
PopsContextMenu.$el.$root = null as any;
|
|
230
234
|
},
|
|
231
235
|
/**
|
|
232
236
|
* 获取菜单容器
|
|
@@ -250,7 +254,7 @@ export const PopsRightClickMenu = {
|
|
|
250
254
|
if (isChildren) {
|
|
251
255
|
$menu.setAttribute("is-children", "true");
|
|
252
256
|
}
|
|
253
|
-
|
|
257
|
+
// 添加动画
|
|
254
258
|
if (config.isAnimation) {
|
|
255
259
|
popsDOMUtils.addClassName($menu, `pops-${popsType}-anim-grid`);
|
|
256
260
|
}
|
|
@@ -269,12 +273,12 @@ export const PopsRightClickMenu = {
|
|
|
269
273
|
},
|
|
270
274
|
/**
|
|
271
275
|
* 获取left、top偏移
|
|
272
|
-
* @param
|
|
276
|
+
* @param $menu 当前生成的菜单元素
|
|
273
277
|
* @param mousePosition 鼠标位置信息
|
|
274
278
|
* @param isMainMenu 是否是主菜单
|
|
275
279
|
*/
|
|
276
280
|
getOffset(
|
|
277
|
-
|
|
281
|
+
$menu: HTMLElement,
|
|
278
282
|
mousePosition: { x: number; y: number },
|
|
279
283
|
parentInfo?: {
|
|
280
284
|
$menu: HTMLElement;
|
|
@@ -287,8 +291,8 @@ export const PopsRightClickMenu = {
|
|
|
287
291
|
bottom: 0,
|
|
288
292
|
left: 0,
|
|
289
293
|
};
|
|
290
|
-
const menuElementWidth = popsDOMUtils.width(
|
|
291
|
-
const menuElementHeight = popsDOMUtils.height(
|
|
294
|
+
const menuElementWidth = popsDOMUtils.width($menu);
|
|
295
|
+
const menuElementHeight = popsDOMUtils.height($menu);
|
|
292
296
|
/**
|
|
293
297
|
* 限制的间隙距离
|
|
294
298
|
*/
|
|
@@ -300,9 +304,9 @@ export const PopsRightClickMenu = {
|
|
|
300
304
|
maxPageLeftOffset += globalThis.scrollX;
|
|
301
305
|
maxPageTopOffset += globalThis.scrollY;
|
|
302
306
|
}
|
|
303
|
-
|
|
307
|
+
// left最大偏移
|
|
304
308
|
const maxLeftOffset = maxPageLeftOffset - menuElementWidth;
|
|
305
|
-
|
|
309
|
+
// top最大偏移
|
|
306
310
|
const maxTopOffset = maxPageTopOffset - menuElementHeight;
|
|
307
311
|
|
|
308
312
|
const chileMenuLeftOrRightDistance = config.chileMenuLeftOrRightDistance;
|
|
@@ -368,20 +372,20 @@ export const PopsRightClickMenu = {
|
|
|
368
372
|
/**
|
|
369
373
|
* 显示菜单
|
|
370
374
|
* @param menuEvent 触发的事件
|
|
371
|
-
* @param
|
|
372
|
-
* @param
|
|
375
|
+
* @param dataConfig
|
|
376
|
+
* @param $listenerRootNode 右键菜单监听的元素
|
|
373
377
|
*/
|
|
374
378
|
showMenu(
|
|
375
379
|
menuEvent: PointerEvent,
|
|
376
|
-
|
|
377
|
-
|
|
380
|
+
dataConfig: PopsRightClickMenuDataConfig[],
|
|
381
|
+
$listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>
|
|
378
382
|
) {
|
|
379
383
|
const menuElement = this.createMenuContainerElement(false);
|
|
380
|
-
Reflect.set(menuElement,
|
|
384
|
+
Reflect.set(menuElement, PopsContextMenu.$data.menuDataKey, {
|
|
381
385
|
child: [],
|
|
382
|
-
});
|
|
386
|
+
} as PopsRightClickMenuRootStoreNodeValue);
|
|
383
387
|
// 添加子元素
|
|
384
|
-
PopsContextMenu.addMenuLiELement(menuEvent, menuElement, menuElement,
|
|
388
|
+
PopsContextMenu.addMenuLiELement(menuEvent, menuElement, menuElement, dataConfig, $listenerRootNode);
|
|
385
389
|
// 添加到页面
|
|
386
390
|
popsDOMUtils.append($shadowRoot, menuElement);
|
|
387
391
|
// 判断容器是否存在
|
|
@@ -398,10 +402,10 @@ export const PopsRightClickMenu = {
|
|
|
398
402
|
* 显示子菜单
|
|
399
403
|
* @param menuEvent 事件
|
|
400
404
|
* @param posInfo 位置信息
|
|
401
|
-
* @param
|
|
402
|
-
* @param
|
|
403
|
-
* @param
|
|
404
|
-
* @param
|
|
405
|
+
* @param dataConfig
|
|
406
|
+
* @param $root 根菜单元素
|
|
407
|
+
* @param $targetLi 父li项元素
|
|
408
|
+
* @param $listenerRootNode 右键菜单监听的元素
|
|
405
409
|
*/
|
|
406
410
|
showClildMenu(
|
|
407
411
|
menuEvent: PointerEvent,
|
|
@@ -409,27 +413,30 @@ export const PopsRightClickMenu = {
|
|
|
409
413
|
clientX: number;
|
|
410
414
|
clientY: number;
|
|
411
415
|
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
+
dataConfig: PopsRightClickMenuDataConfig[],
|
|
417
|
+
$root: HTMLDivElement,
|
|
418
|
+
$targetLi: HTMLLIElement,
|
|
419
|
+
$listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>
|
|
416
420
|
) {
|
|
417
421
|
const menuElement = this.createMenuContainerElement(true);
|
|
418
|
-
Reflect.set(menuElement,
|
|
419
|
-
parent:
|
|
420
|
-
root:
|
|
421
|
-
});
|
|
422
|
+
Reflect.set(menuElement, PopsContextMenu.$data.menuDataKey, {
|
|
423
|
+
parent: $targetLi,
|
|
424
|
+
root: $root,
|
|
425
|
+
} as PopsRightClickMenuItemStoreNodeValue);
|
|
422
426
|
// 根菜单数据
|
|
423
|
-
const rootElementMenuData = Reflect.get(
|
|
427
|
+
const rootElementMenuData: PopsRightClickMenuRootStoreNodeValue = Reflect.get(
|
|
428
|
+
$root,
|
|
429
|
+
PopsContextMenu.$data.menuDataKey
|
|
430
|
+
);
|
|
424
431
|
rootElementMenuData.child.push(menuElement);
|
|
425
432
|
// 添加子元素
|
|
426
|
-
PopsContextMenu.addMenuLiELement(menuEvent,
|
|
433
|
+
PopsContextMenu.addMenuLiELement(menuEvent, $root, menuElement, dataConfig, $listenerRootNode);
|
|
427
434
|
// 添加到页面
|
|
428
435
|
popsDOMUtils.append($shadowRoot, menuElement);
|
|
429
|
-
const $parentMenu =
|
|
436
|
+
const $parentMenu = $targetLi.closest<HTMLElement>(".pops-rightClickMenu")!;
|
|
430
437
|
this.handlerShowMenuCSS(menuElement, posInfo, {
|
|
431
438
|
$menu: $parentMenu,
|
|
432
|
-
$parentItem:
|
|
439
|
+
$parentItem: $targetLi,
|
|
433
440
|
});
|
|
434
441
|
return menuElement;
|
|
435
442
|
},
|
|
@@ -462,7 +469,7 @@ export const PopsRightClickMenu = {
|
|
|
462
469
|
popsDOMUtils.css($menu, {
|
|
463
470
|
...offset,
|
|
464
471
|
});
|
|
465
|
-
|
|
472
|
+
// 过渡动画
|
|
466
473
|
if (config.isAnimation) {
|
|
467
474
|
popsDOMUtils.addClassName($menu, `pops-${popsType}-anim-show`);
|
|
468
475
|
}
|
|
@@ -474,23 +481,23 @@ export const PopsRightClickMenu = {
|
|
|
474
481
|
/**
|
|
475
482
|
* 获取菜单项的元素
|
|
476
483
|
* @param menuEvent 事件
|
|
477
|
-
* @param
|
|
478
|
-
* @param
|
|
479
|
-
* @param
|
|
480
|
-
* @param
|
|
484
|
+
* @param $root 根元素
|
|
485
|
+
* @param $menu 菜单元素
|
|
486
|
+
* @param dataConfig 配置
|
|
487
|
+
* @param $listenerRootNode 右键菜单监听的元素
|
|
481
488
|
*/
|
|
482
489
|
addMenuLiELement(
|
|
483
490
|
menuEvent: PointerEvent,
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
491
|
+
$root: HTMLDivElement,
|
|
492
|
+
$menu: HTMLDivElement,
|
|
493
|
+
dataConfig: PopsRightClickMenuDataConfig[],
|
|
494
|
+
$listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>
|
|
488
495
|
) {
|
|
489
496
|
const menuEventTarget = menuEvent.target;
|
|
490
|
-
const menuULElement =
|
|
491
|
-
|
|
497
|
+
const menuULElement = $menu.querySelector<HTMLUListElement>("ul")!;
|
|
498
|
+
dataConfig.forEach((item) => {
|
|
492
499
|
const menuLiElement = popsDOMUtils.parseTextToDOM<HTMLLIElement>(`<li></li>`);
|
|
493
|
-
|
|
500
|
+
// 判断有无图标,有就添加进去
|
|
494
501
|
if (typeof item.icon === "string" && item.icon.trim() !== "") {
|
|
495
502
|
const iconSVGHTML = PopsIcon.getIcon(item.icon) ?? item.icon;
|
|
496
503
|
const iconElement = popsDOMUtils.parseTextToDOM(
|
|
@@ -498,13 +505,13 @@ export const PopsRightClickMenu = {
|
|
|
498
505
|
);
|
|
499
506
|
menuLiElement.appendChild(iconElement);
|
|
500
507
|
}
|
|
501
|
-
|
|
508
|
+
// 插入文字
|
|
502
509
|
menuLiElement.insertAdjacentHTML("beforeend", PopsSafeUtils.getSafeHTML(`<span>${item.text}</span>`));
|
|
503
|
-
|
|
510
|
+
// 如果存在子数据,显示
|
|
504
511
|
if (item.item && Array.isArray(item.item)) {
|
|
505
512
|
popsDOMUtils.addClassName(menuLiElement, `pops-${popsType}-item`);
|
|
506
513
|
}
|
|
507
|
-
|
|
514
|
+
// 鼠标|触摸 移入事件
|
|
508
515
|
// 在移动端会先触发touchstart再然后mouseenter
|
|
509
516
|
let isTriggerTouchEvent = false;
|
|
510
517
|
/**
|
|
@@ -519,24 +526,34 @@ export const PopsRightClickMenu = {
|
|
|
519
526
|
}
|
|
520
527
|
Array.from(menuULElement.children as any as HTMLLIElement[]).forEach((liElement) => {
|
|
521
528
|
popsDOMUtils.removeClassName(liElement, `pops-${popsType}-is-visited`);
|
|
522
|
-
const li_menuData = Reflect.get(
|
|
529
|
+
const li_menuData: PopsRightClickMenuItemStoreNodeValue = Reflect.get(
|
|
530
|
+
liElement,
|
|
531
|
+
PopsContextMenu.$data.menuDataKey
|
|
532
|
+
);
|
|
523
533
|
if (!li_menuData) {
|
|
524
534
|
return;
|
|
525
535
|
}
|
|
526
|
-
function removeElement(
|
|
527
|
-
|
|
528
|
-
|
|
536
|
+
function removeElement($el: HTMLElement | undefined | null) {
|
|
537
|
+
if (!$el) return;
|
|
538
|
+
$el.querySelectorAll<HTMLLIElement>("ul li").forEach(($ele) => {
|
|
539
|
+
const menuData: PopsRightClickMenuItemStoreNodeValue = Reflect.get(
|
|
540
|
+
$ele,
|
|
541
|
+
PopsContextMenu.$data.menuDataKey
|
|
542
|
+
);
|
|
529
543
|
if (menuData?.child) {
|
|
530
544
|
removeElement(menuData.child);
|
|
531
545
|
}
|
|
532
546
|
});
|
|
533
|
-
|
|
547
|
+
$el.remove();
|
|
534
548
|
}
|
|
535
|
-
|
|
549
|
+
// 遍历根元素的上的__menuData__.child,判断
|
|
536
550
|
removeElement(li_menuData.child);
|
|
537
551
|
});
|
|
538
|
-
|
|
539
|
-
const root_menuData = Reflect.get(
|
|
552
|
+
// 清理根元素上的children不存在于页面中的元素
|
|
553
|
+
const root_menuData: PopsRightClickMenuRootStoreNodeValue = Reflect.get(
|
|
554
|
+
$root,
|
|
555
|
+
PopsContextMenu.$data.menuDataKey
|
|
556
|
+
);
|
|
540
557
|
for (let index = 0; index < root_menuData.child.length; index++) {
|
|
541
558
|
const element = root_menuData.child[index];
|
|
542
559
|
if (!$shadowRoot.contains(element)) {
|
|
@@ -556,13 +573,13 @@ export const PopsRightClickMenu = {
|
|
|
556
573
|
clientY: rect.top,
|
|
557
574
|
},
|
|
558
575
|
item.item,
|
|
559
|
-
|
|
576
|
+
$root,
|
|
560
577
|
menuLiElement,
|
|
561
|
-
|
|
578
|
+
$listenerRootNode
|
|
562
579
|
);
|
|
563
|
-
Reflect.set(menuLiElement,
|
|
580
|
+
Reflect.set(menuLiElement, PopsContextMenu.$data.menuDataKey, {
|
|
564
581
|
child: childMenu,
|
|
565
|
-
});
|
|
582
|
+
} as PopsRightClickMenuItemStoreNodeValue);
|
|
566
583
|
}
|
|
567
584
|
/**
|
|
568
585
|
* 点击事件
|
|
@@ -583,20 +600,20 @@ export const PopsRightClickMenu = {
|
|
|
583
600
|
clickEvent as PointerEvent,
|
|
584
601
|
menuEvent,
|
|
585
602
|
menuLiElement,
|
|
586
|
-
|
|
603
|
+
$listenerRootNode
|
|
587
604
|
);
|
|
588
605
|
if (typeof callbackResult === "boolean" && callbackResult == false) {
|
|
589
606
|
return;
|
|
590
607
|
}
|
|
591
608
|
}
|
|
592
|
-
|
|
609
|
+
// 取消绑定的鼠标/触摸事件,防止关闭的时候再次触发
|
|
593
610
|
Array.from(menuULElement.children as any as HTMLLIElement[]).forEach((liEle) => {
|
|
594
611
|
popsDOMUtils.off(liEle, "mouseenter touchstart");
|
|
595
612
|
});
|
|
596
|
-
PopsContextMenu.closeAllMenu(
|
|
613
|
+
PopsContextMenu.closeAllMenu($root);
|
|
597
614
|
}
|
|
598
615
|
popsDOMUtils.on(menuLiElement, "mouseenter touchstart", liElementHoverEvent);
|
|
599
|
-
|
|
616
|
+
// 项-点击事件
|
|
600
617
|
popsDOMUtils.on(menuLiElement, "click", liElementClickEvent);
|
|
601
618
|
menuULElement.appendChild(menuLiElement);
|
|
602
619
|
});
|
|
@@ -604,12 +621,12 @@ export const PopsRightClickMenu = {
|
|
|
604
621
|
};
|
|
605
622
|
|
|
606
623
|
// 添加右键菜单事件
|
|
607
|
-
PopsContextMenu.addContextMenuEvent(config
|
|
624
|
+
PopsContextMenu.addContextMenuEvent(config.$target, config.targetSelector!);
|
|
608
625
|
// 添加全局点击检测
|
|
609
626
|
PopsContextMenu.addWindowCheckClickListener();
|
|
610
627
|
return {
|
|
611
628
|
guid: guid,
|
|
612
|
-
config: config as DeepRequired<
|
|
629
|
+
config: config as DeepRequired<PopsRightClickMenuConfig>,
|
|
613
630
|
addWindowCheckClickListener: PopsContextMenu.addWindowCheckClickListener,
|
|
614
631
|
removeWindowCheckClickListener: PopsContextMenu.removeWindowCheckClickListener,
|
|
615
632
|
addContextMenuEvent: PopsContextMenu.addContextMenuEvent,
|
|
@@ -619,7 +636,7 @@ export const PopsRightClickMenu = {
|
|
|
619
636
|
*/
|
|
620
637
|
removeInitEventListener: {
|
|
621
638
|
contextMenu() {
|
|
622
|
-
PopsContextMenu.removeContextMenuEvent(config
|
|
639
|
+
PopsContextMenu.removeContextMenuEvent(config.$target as Window, config.targetSelector!);
|
|
623
640
|
},
|
|
624
641
|
windowClick() {
|
|
625
642
|
PopsContextMenu.removeWindowCheckClickListener();
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PopsGeneralConfig } from "../../../types/components";
|
|
2
2
|
import type { PopsIconType } from "../../../types/icon";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PopsPanelGeneralConfig } from "../../panel/types/components-common";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 存储在pops.rightClickMenu的右键菜单根元素上的属性
|
|
7
|
+
*/
|
|
8
|
+
export type PopsRightClickMenuRootStoreNodeValue = {
|
|
9
|
+
child: HTMLElement[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 存储在pops.rightClickMenu的右键菜单子菜单的根元素上的属性
|
|
13
|
+
*/
|
|
14
|
+
export type PopsRightClickMenuChildRootStoreNodeValue = {
|
|
15
|
+
parent: HTMLElement;
|
|
16
|
+
root: HTMLElement;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 存储在pops.rightClickMenu的右键菜单每一项元素上的属性
|
|
20
|
+
*/
|
|
21
|
+
export type PopsRightClickMenuItemStoreNodeValue = {
|
|
22
|
+
child?: HTMLElement;
|
|
23
|
+
parent?: HTMLElement;
|
|
24
|
+
root?: HTMLElement;
|
|
25
|
+
};
|
|
4
26
|
|
|
5
27
|
/**
|
|
6
28
|
* pops.rightClickMenu的右键菜单配置
|
|
7
29
|
*/
|
|
8
|
-
export interface
|
|
30
|
+
export interface PopsRightClickMenuDataConfig {
|
|
9
31
|
/**
|
|
10
32
|
* svg图标,留空则是没图标
|
|
11
33
|
* @default ""
|
|
@@ -24,8 +46,8 @@ export interface PopsRightClickMenuDataDetails {
|
|
|
24
46
|
* 点击的回调函数
|
|
25
47
|
* @param clickEvent 点击菜单的click事件
|
|
26
48
|
* @param contextMenuEvent 触发的contextmenu事件
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
49
|
+
* @param $li <li>元素
|
|
50
|
+
* @param $listenerRootNode 右键菜单监听的元素
|
|
29
51
|
* @returns
|
|
30
52
|
* + true(默认) 关闭菜单
|
|
31
53
|
* + false 不关闭菜单
|
|
@@ -34,25 +56,25 @@ export interface PopsRightClickMenuDataDetails {
|
|
|
34
56
|
callback?: (
|
|
35
57
|
clickEvent: PointerEvent,
|
|
36
58
|
contextMenuEvent: PointerEvent,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
) =>
|
|
59
|
+
$li: HTMLLIElement,
|
|
60
|
+
$listenerRootNode: NonNullable<PopsRightClickMenuConfig["$target"]>
|
|
61
|
+
) => IPromise<boolean | void>;
|
|
40
62
|
/**
|
|
41
63
|
* 子项配置
|
|
42
64
|
*/
|
|
43
|
-
item?:
|
|
65
|
+
item?: PopsRightClickMenuDataConfig[] | null;
|
|
44
66
|
}
|
|
45
67
|
|
|
46
68
|
/**
|
|
47
69
|
* pops.rightClickMenu
|
|
48
70
|
*/
|
|
49
|
-
export interface
|
|
50
|
-
extends Pick<
|
|
71
|
+
export interface PopsRightClickMenuConfig
|
|
72
|
+
extends Pick<PopsGeneralConfig, "useShadowRoot" | "beforeAppendToPageCallBack" | "zIndex" | "style" | "only"> {
|
|
51
73
|
/**
|
|
52
74
|
* 目标元素
|
|
53
75
|
* @default document.documentElement
|
|
54
76
|
*/
|
|
55
|
-
target?: HTMLElement | Window | EventTarget | Node;
|
|
77
|
+
$target?: HTMLElement | Window | EventTarget | Node;
|
|
56
78
|
/**
|
|
57
79
|
* 目标的子元素选择器,默认为空
|
|
58
80
|
* @default null
|
|
@@ -66,7 +88,7 @@ export interface PopsRightClickMenuDetails
|
|
|
66
88
|
/**
|
|
67
89
|
* 右键菜单数据
|
|
68
90
|
*/
|
|
69
|
-
data:
|
|
91
|
+
data: PopsRightClickMenuDataConfig[];
|
|
70
92
|
/**
|
|
71
93
|
* 子菜单的左右偏移距离
|
|
72
94
|
* @default 0
|
|
@@ -81,7 +103,7 @@ export interface PopsRightClickMenuDetails
|
|
|
81
103
|
* (可选)元素的className,值为空的话就不设置
|
|
82
104
|
* @default ""
|
|
83
105
|
*/
|
|
84
|
-
className?:
|
|
106
|
+
className?: PopsPanelGeneralConfig<any>["className"];
|
|
85
107
|
/**
|
|
86
108
|
* 是否启用动画,默认false
|
|
87
109
|
*
|
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
import type { PopsSearchSuggestionData,
|
|
1
|
+
import type { PopsSearchSuggestionData, PopsSearchSuggestionConfig } from "./types/index";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
const data: DeepRequired<PopsSearchSuggestionData
|
|
3
|
+
export const PopsSearchSuggestionDefaultConfig = (): DeepRequired<PopsSearchSuggestionConfig<any>> => {
|
|
4
|
+
const data: DeepRequired<PopsSearchSuggestionData<any>>[] = [];
|
|
5
5
|
for (let index = 0; index < 10; index++) {
|
|
6
6
|
data.push({
|
|
7
7
|
value: `测试${index}`,
|
|
8
8
|
enableDeleteButton: true,
|
|
9
9
|
deleteButtonClickCallback(event, $dataItem, dataItem, config) {
|
|
10
|
-
|
|
10
|
+
const value = dataItem.value;
|
|
11
|
+
console.log("删除当前项:" + value, [event, $dataItem, dataItem, config]);
|
|
11
12
|
return true;
|
|
12
13
|
},
|
|
13
14
|
itemView(dateItem) {
|
|
14
15
|
return `${dateItem.value}-html`;
|
|
15
16
|
},
|
|
16
17
|
clickCallback(event, $dataItem, dataItem, config) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const isUpdateInputValue = index % 2 === 0 ? true : false;
|
|
19
|
+
const value = dataItem.value;
|
|
20
|
+
if (isUpdateInputValue) {
|
|
21
|
+
console.log("item项的点击回调,更新input内的值:" + value, [event, $dataItem, dataItem, config, value]);
|
|
22
|
+
} else {
|
|
23
|
+
console.log("item项的点击回调:" + value, [event, $dataItem, dataItem, config, value]);
|
|
24
|
+
}
|
|
25
|
+
return isUpdateInputValue;
|
|
20
26
|
},
|
|
21
27
|
selectCallback(event, $dataItem, dataItem, config) {
|
|
22
|
-
|
|
28
|
+
const value = dataItem.value;
|
|
29
|
+
console.log("item项的选中回调:" + value, [event, $dataItem, dataItem, config]);
|
|
23
30
|
},
|
|
24
31
|
});
|
|
25
32
|
}
|
|
26
33
|
return {
|
|
27
34
|
// @ts-ignore
|
|
28
|
-
target: null,
|
|
35
|
+
$target: null,
|
|
29
36
|
// @ts-ignore
|
|
30
|
-
inputTarget: null,
|
|
31
|
-
selfDocument: document,
|
|
37
|
+
$inputTarget: null,
|
|
38
|
+
$selfDocument: document,
|
|
32
39
|
data: data,
|
|
33
40
|
useShadowRoot: true,
|
|
34
41
|
className: "",
|