From 3e2ade1a2e670013a05bdb1d4788d00aea47a8de Mon Sep 17 00:00:00 2001 From: bplok20010 Date: Thu, 28 May 2020 01:48:07 +0800 Subject: [PATCH] =?UTF-8?q?2.0.2=20=E6=96=B0=E5=A2=9E=EF=BC=9AoutsideHideE?= =?UTF-8?q?ventName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +- docs/asset-manifest.json | 6 +- docs/index.html | 2 +- ...e44.chunk.css => index.f7f3b06b.chunk.css} | 0 docs/static/js/2.14d2c2bc.chunk.js | 1 + docs/static/js/2.f1bfc8b5.chunk.js | 1 - docs/static/js/index.8833ee44.chunk.js | 1 - docs/static/js/index.f7f3b06b.chunk.js | 1 + package-lock.json | 2 +- package.json | 3 +- src/index.tsx | 109 +++++++----------- 11 files changed, 58 insertions(+), 75 deletions(-) rename docs/static/css/{index.8833ee44.chunk.css => index.f7f3b06b.chunk.css} (100%) create mode 100644 docs/static/js/2.14d2c2bc.chunk.js delete mode 100644 docs/static/js/2.f1bfc8b5.chunk.js delete mode 100644 docs/static/js/index.8833ee44.chunk.js create mode 100644 docs/static/js/index.f7f3b06b.chunk.js diff --git a/README.md b/README.md index 4e898ab..3b3e7cf 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,8 @@ export interface TriggerProps { showAction?: ShowActionType | ShowActionType[] | null; /** 隐藏触发事件,同action合并 */ hideAction?: HideActionType | HideActionType[] | null; + /** 点击popup或trigger元素以外的节点时隐藏popup事件 */ + outsideHideEventName?: Array | keyof HTMLElementEventMap; /** 显示/隐藏延迟时间 */ delay?: number | Delay; /** 触发后弹出显示内容 */ @@ -145,6 +147,8 @@ export interface TriggerProps { forceRender?: boolean; /** jquery-ui/position.js 的配置参数 */ position?: PositionOptions; + /** portal挂载容器 */ + container?: PortalProps["container"]; /** 内部使用 */ getDocument?: () => Document | Element; /** 内部使用 */ @@ -177,7 +181,8 @@ export default Trigger; defaultPopupVisible: false, action: ["click"], showAction: [], - hideAction: [], + hideAction: [], + outsideHideEventName: ["mousedown", "click", "scroll"], delay: 0, getDocument: () => window.document, container: document.body, diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json index f704383..3b18ac7 100644 --- a/docs/asset-manifest.json +++ b/docs/asset-manifest.json @@ -1,7 +1,7 @@ { - "index.css": "static/css/index.8833ee44.chunk.css", - "index.js": "static/js/index.8833ee44.chunk.js", + "index.css": "static/css/index.f7f3b06b.chunk.css", + "index.js": "static/js/index.f7f3b06b.chunk.js", "runtime-index.js": "static/js/runtime-index.7c9988e7.js", - "static/js/2.f1bfc8b5.chunk.js": "static/js/2.f1bfc8b5.chunk.js", + "static/js/2.14d2c2bc.chunk.js": "static/js/2.14d2c2bc.chunk.js", "index.html": "index.html" } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 76149f3..f781bcf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -trigger
\ No newline at end of file +trigger
\ No newline at end of file diff --git a/docs/static/css/index.8833ee44.chunk.css b/docs/static/css/index.f7f3b06b.chunk.css similarity index 100% rename from docs/static/css/index.8833ee44.chunk.css rename to docs/static/css/index.f7f3b06b.chunk.css diff --git a/docs/static/js/2.14d2c2bc.chunk.js b/docs/static/js/2.14d2c2bc.chunk.js new file mode 100644 index 0000000..c0f0f90 --- /dev/null +++ b/docs/static/js/2.14d2c2bc.chunk.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(123)},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(124)},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(93))},function(e,t,n){var r=n(4),o=n(52),i=n(7),a=n(55),l=n(56),u=n(94),c=o("wks"),s=r.Symbol,f=u?s:s&&s.withoutSetter||a;e.exports=function(e){return i(c,e)||(l&&i(s,e)?c[e]=s[e]:c[e]=f("Symbol."+e)),c[e]}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(51);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(132);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},function(e,t,n){"use strict";var r=n(12),o=n(6),i=n(77),a=n(10),l=n(27),u=n(26),c=n(130),s=n(78),f=n(79),p=n(5),d=n(46),h=p("isConcatSpreadable"),m=d>=51||!o((function(){var e=[];return e[h]=!1,e.concat()[0]!==e})),v=f("concat"),y=function(e){if(!a(e))return!1;var t=e[h];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,forced:!m||!v},{concat:function(e){var t,n,r,o,i,a=l(this),f=s(a,0),p=0;for(t=-1,r=arguments.length;t9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n=9007199254740991)throw TypeError("Maximum allowed index exceeded");c(f,p++,i)}return f.length=p,f}})},function(e,t,n){var r=n(13),o=n(6),i=n(7),a=Object.defineProperty,l={},u=function(e){throw e};e.exports=function(e,t){if(i(l,e))return l[e];t||(t={});var n=[][e],c=!!i(t,"ACCESSORS")&&t.ACCESSORS,s=i(t,0)?t[0]:u,f=i(t,1)?t[1]:void 0;return l[e]=!!n&&!o((function(){if(c&&!r)return!0;var e={length:-1};c?a(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,s,f)}))}},function(e,t,n){"use strict";var r=n(6);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(20),o=n(53);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"\xa9 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(4),o=n(35),i=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,n){var r=n(13),o=n(6),i=n(36);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(6);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(e,t,n){var r,o=n(11),i=n(95),a=n(39),l=n(38),u=n(62),c=n(36),s=n(40),f=s("IE_PROTO"),p=function(){},d=function(e){return"