Skip to content

Commit 3e2ade1

Browse files
committed
2.0.2
新增:outsideHideEventName
1 parent 7e9132d commit 3e2ade1

11 files changed

+58
-75
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ export interface TriggerProps {
102102
showAction?: ShowActionType | ShowActionType[] | null;
103103
/** 隐藏触发事件,同action合并 */
104104
hideAction?: HideActionType | HideActionType[] | null;
105+
/** 点击popup或trigger元素以外的节点时隐藏popup事件 */
106+
outsideHideEventName?: Array<keyof HTMLElementEventMap> | keyof HTMLElementEventMap;
105107
/** 显示/隐藏延迟时间 */
106108
delay?: number | Delay;
107109
/** 触发后弹出显示内容 */
@@ -145,6 +147,8 @@ export interface TriggerProps {
145147
forceRender?: boolean;
146148
/** jquery-ui/position.js 的配置参数 */
147149
position?: PositionOptions;
150+
/** portal挂载容器 */
151+
container?: PortalProps["container"];
148152
/** 内部使用 */
149153
getDocument?: () => Document | Element;
150154
/** 内部使用 */
@@ -177,7 +181,8 @@ export default Trigger;
177181
defaultPopupVisible: false,
178182
action: ["click"],
179183
showAction: [],
180-
hideAction: [],
184+
hideAction: [],
185+
outsideHideEventName: ["mousedown", "click", "scroll"],
181186
delay: 0,
182187
getDocument: () => window.document,
183188
container: document.body,

docs/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"index.css": "static/css/index.8833ee44.chunk.css",
3-
"index.js": "static/js/index.8833ee44.chunk.js",
2+
"index.css": "static/css/index.f7f3b06b.chunk.css",
3+
"index.js": "static/js/index.f7f3b06b.chunk.js",
44
"runtime-index.js": "static/js/runtime-index.7c9988e7.js",
5-
"static/js/2.f1bfc8b5.chunk.js": "static/js/2.f1bfc8b5.chunk.js",
5+
"static/js/2.14d2c2bc.chunk.js": "static/js/2.14d2c2bc.chunk.js",
66
"index.html": "index.html"
77
}

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html><head><meta charset="utf-8"/><title>trigger</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"/><style>.demo{width:800px;height:450px;margin:100px auto;background:#fff;font-size:12px;overflow:auto}</style><link href="static/css/index.8833ee44.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime-index.7c9988e7.js"></script><script src="static/js/2.f1bfc8b5.chunk.js"></script><script src="static/js/index.8833ee44.chunk.js"></script></body></html>
1+
<!doctype html><html><head><meta charset="utf-8"/><title>trigger</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"/><style>.demo{width:800px;height:450px;margin:100px auto;background:#fff;font-size:12px;overflow:auto}</style><link href="static/css/index.f7f3b06b.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime-index.7c9988e7.js"></script><script src="static/js/2.14d2c2bc.chunk.js"></script><script src="static/js/index.f7f3b06b.chunk.js"></script></body></html>

docs/static/js/2.14d2c2bc.chunk.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/js/2.f1bfc8b5.chunk.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/js/index.8833ee44.chunk.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/js/index.f7f3b06b.chunk.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"tsc": "tsc",
2121
"demo": "packez server ./examples/index.js -d dist -w -c",
2222
"test": "jest",
23-
"build": "run-s tsc cjs esm docs"
23+
"clear": "rimraf lib cjs esm docs dist",
24+
"build": "run-s clear tsc cjs esm docs"
2425
},
2526
"repository": {
2627
"type": "git",

0 commit comments

Comments
 (0)