-
Notifications
You must be signed in to change notification settings - Fork 0
/
4600-761bd97757dda0c57232.js
1 lines (1 loc) · 67.3 KB
/
4600-761bd97757dda0c57232.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[4600],{94600:(n,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>z});var t=a(73450),p=a(27378),o=a(57318),e=a(57097),c=a(96681),l=a(82285),u=a(71457),i=a(24246);function k(n,s){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable}))),a.push.apply(a,t)}return a}function r(n){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?k(Object(a),!0).forEach((function(s){(0,t.Z)(n,s,a[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):k(Object(a)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s))}))}return n}var d=function(){return(0,i.jsxs)("div",{className:"zent-doc-tooltip-container",children:[(0,i.jsx)(e.u,{trigger:"hover",title:"鼠标移入触发方式",children:(0,i.jsx)(c.z,{type:"primary",children:"移入鼠标"})}),(0,i.jsx)(e.u,{trigger:"click",title:"鼠标点击触发方式",children:(0,i.jsx)(c.z,{type:"primary",children:"点击鼠标"})}),(0,i.jsx)(e.u,{trigger:"focus",title:"获得输入焦点触发方式",children:(0,i.jsx)(l.I,{defaultValue:"点击获取焦点"})})]})},g=function(){var n="hover";return(0,i.jsxs)("div",{className:"zent-doc-tooltip-positions",children:[(0,i.jsxs)("div",{className:"zent-doc-tooltip-positions-top-row",children:[(0,i.jsx)(e.u,{trigger:n,position:"top-left",title:"TL",children:(0,i.jsx)(c.z,{children:"TopLeft"})}),(0,i.jsx)(e.u,{trigger:n,position:"top-center",title:"TC",children:(0,i.jsx)(c.z,{children:"TopCenter"})}),(0,i.jsx)(e.u,{trigger:n,position:"top-right",title:"TR",children:(0,i.jsx)(c.z,{children:"TopRight"})})]}),(0,i.jsxs)("div",{className:"zent-doc-tooltip-positions-bottom-row",children:[(0,i.jsx)(e.u,{trigger:n,position:"bottom-left",title:"BL",children:(0,i.jsx)(c.z,{children:"BottomLeft"})}),(0,i.jsx)(e.u,{trigger:n,position:"bottom-center",title:"BC",children:(0,i.jsx)(c.z,{children:"BottomCenter"})}),(0,i.jsx)(e.u,{trigger:n,position:"bottom-right",title:"BR",children:(0,i.jsx)(c.z,{children:"BottomRight"})})]}),(0,i.jsxs)("div",{className:"zent-doc-tooltip-positions-left-col",children:[(0,i.jsx)(e.u,{trigger:n,position:"left-top",title:"LT",children:(0,i.jsx)(c.z,{children:"LeftTop"})}),(0,i.jsx)(e.u,{trigger:n,position:"left-center",title:"LC",children:(0,i.jsx)(c.z,{children:"LeftCenter"})}),(0,i.jsx)(e.u,{trigger:n,position:"left-bottom",title:"LB",children:(0,i.jsx)(c.z,{children:"LeftBottom"})})]}),(0,i.jsxs)("div",{className:"zent-doc-tooltip-positions-right-col",children:[(0,i.jsx)(e.u,{trigger:n,position:"right-top",title:"RT",children:(0,i.jsx)(c.z,{children:"RightTop"})}),(0,i.jsx)(e.u,{trigger:n,position:"right-center",title:"RC",children:(0,i.jsx)(c.z,{children:"RightCenter"})}),(0,i.jsx)(e.u,{trigger:n,position:"right-bottom",title:"RB",children:(0,i.jsx)(c.z,{children:"RightBottom"})})]})]})},m=function(){return(0,i.jsxs)("div",{className:"zent-doc-tooltip-container",children:[(0,i.jsx)(e.u,{centerArrow:!0,trigger:"hover",position:"top-left",title:"centerArrow 为 true",children:(0,i.jsx)("span",{className:"zent-doc-tooltip-tag",children:"Y"})}),(0,i.jsx)(e.u,{trigger:"hover",position:"top-left",title:"centerArrow 为 false",children:(0,i.jsx)("span",{className:"zent-doc-tooltip-tag",children:"N"})})]})},h=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{visible:!1}),(0,t.Z)(this,"close",(()=>{this.setState({visible:!1})})),(0,t.Z)(this,"open",(()=>{this.setState({visible:!0})}))}render(){var n=(0,i.jsx)("div",{children:(0,i.jsx)("p",{style:{marginBottom:10},children:"可以在 Tooltip 外部关闭"})});return(0,i.jsxs)("div",{className:"zent-doc-tooltip-none-trigger-container",children:[(0,i.jsx)(e.u,{title:n,trigger:"none",visible:this.state.visible,children:(0,i.jsx)(c.z,{type:"primary",onClick:this.open,children:"打开"})}),(0,i.jsx)(c.z,{disabled:!this.state.visible,onClick:this.close,children:"外部关闭"})]})}}return(0,i.jsx)(n,{})},v=function(){return(0,i.jsxs)("div",{className:"zent-doc-tooltip-container",children:[(0,i.jsx)(e.u,{trigger:"hover",title:"内容",fixMouseEventsOnDisabledChildren:!0,children:(0,i.jsx)(c.z,{type:"primary",disabled:!0,children:"Button"})}),(0,i.jsx)(e.u,{trigger:"hover",title:"内容",children:(0,i.jsx)(l.I,{disabled:!0})}),(0,i.jsx)(e.u,{trigger:"hover",title:"内容",children:(0,i.jsx)(u.Y,{disabled:!0,style:{marginLeft:"12px"}})}),(0,i.jsx)(e.u,{trigger:"hover",title:"内容",fixMouseEventsOnDisabledChildren:!0,children:(0,i.jsx)(c.z.Directive,{type:"primary",disabled:!0,children:(0,i.jsx)("a",{href:"",children:" ButtonDirective "})})})]})};function b(n){return(0,i.jsx)(n.tag,r(r({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function f(n){return(0,i.jsx)(b,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function y(n){return(0,i.jsx)(b,{tag:"style",html:n.style})}function j(n,s){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(s+=n.offsetTop),j(n.parentNode,s);return s}class x extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{showCode:!1}),(0,t.Z)(this,"toggle",(()=>{this.setState({showCode:!this.state.showCode})}))}render(){var n=this.state.showCode,s=this.props,a=s.title,t=s.src,p=s.children;return(0,i.jsxs)("div",{className:"zandoc-react-demo",children:[(0,i.jsx)("div",{className:"zandoc-react-demo__preview",children:p}),(0,i.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,i.jsx)("div",{className:"zandoc-react-demo__title",children:(0,i.jsx)("p",{children:a||""})}),(0,i.jsx)("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle ".concat(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})]}),n&&(0,i.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,i.jsx)(b,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class z extends p.Component{componentDidMount(){var n=location.hash;if(n){var s=document.querySelector('a[href="'.concat(n,'"]'));s&&(0,o.l)(document.documentElement,0,j(s,-9))}}render(){return p.createElement("div",{className:"zandoc-react-container"},p.createElement(y,{style:".zent-doc-tooltip-container {\n\t\tdisplay: flex;\n\t\tjustify-content: left;\n\t\talign-items: center;\n\t}\n\n\t\t.zent-doc-tooltip-container .zent-doc-tooltip-tag {\n\t\t\tborder: 1px solid #e5e5e5;\n\t\t\tborder-radius: 20%;\n\t\t\tpadding: 3px;\n\t\t\tfont-size: 12px;\n\t\t\tcursor: default\n\t\t}\n\n\t\t.zent-doc-tooltip-container .zent-doc-tooltip-tag:not(:last-child) {\n\t\tmargin-right: 10px;\n}\n\n\t\t.zent-doc-tooltip-container .zent-input-wrapper {\n\t\t\tmargin-left: 10px;\n\t\t}\n\n.zent-doc-tooltip-positions {\n position: relative;\n }\n\n.zent-doc-tooltip-positions-top-row,\n\t\t.zent-doc-tooltip-positions-bottom-row {\n\t\t\tdisplay: flex;\n justify-content: center;\n }\n\n.zent-doc-tooltip-positions-top-row .zent-tooltip-wrapper:not(:last-child), .zent-doc-tooltip-positions-bottom-row .zent-tooltip-wrapper:not(:last-child) {\n margin-right: 10px\n }\n\n.zent-doc-tooltip-positions-bottom-row {\n margin-top: 200px;\n }\n\n.zent-doc-tooltip-positions-left-col, .zent-doc-tooltip-positions-right-col {\n position: absolute;\n top: 0;\n display: flex;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n }\n\n.zent-doc-tooltip-positions-left-col .zent-btn, .zent-doc-tooltip-positions-right-col .zent-btn {\n\t\t\t\tmargin-left: 0 !important;\n\t\t\t}\n\n.zent-doc-tooltip-positions-left-col .zent-btn:not(:last-child), .zent-doc-tooltip-positions-right-col .zent-btn:not(:last-child) {\n margin-bottom: 10px;\n }\n\n.zent-doc-tooltip-positions-left-col {\n left: 0;\n }\n\n.zent-doc-tooltip-positions-right-col {\n right: 0;\n }\n\n.zent-doc-tooltip-positions .zent-tooltip-wrapper .zent-btn {\n width: 120px;\n }\n\n.zent-doc-tooltip-none-trigger-container {\n display: flex;\n justify-content: left;\n\t}\n\n.zent-doc-tooltip-none-trigger-container .zent-tooltip-wrapper {\n\t\t\tmargin-right: 10px;\n\t\t}"}),p.createElement(f,{html:'<h2 class="anchor-heading"><a href="#tooltip">¶</a><a href="javascript:void(0)" id="tooltip" class="anchor-point"></a>Tooltip</h2>\n<ul>\n<li>多种触发方式:点击,鼠标移入,获得输入焦点,默认为 <code>hover</code> 时触发</li>\n<li>只单纯做展示提示同 HTML <code>title</code> 属性,不承载过多的复杂操作</li>\n</ul>\n<h3 class="anchor-heading"><a href="#dai-ma-yan-shi">¶</a><a href="javascript:void(0)" id="dai-ma-yan-shi" class="anchor-point"></a>代码演示</h3>'}),p.createElement(x,{title:"三种触发方式: 点击,鼠标移入,获得输入焦点",id:"Demotrigger",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tooltip</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Input</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>鼠标移入触发方式<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>移入鼠标<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>click<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>鼠标点击触发方式<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>点击鼠标<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>focus<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>获得输入焦点触发方式<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Input</span></span> <span class="token attr-name">defaultValue</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>点击获取焦点<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(d)),p.createElement(x,{title:"12种定位",id:"Demopositions",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tooltip</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> trigger <span class="token operator">=</span> <span class="token string">\'hover\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-positions<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-positions-top-row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>TL<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">TopLeft</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-center<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>TC<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">TopCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-right<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>TR<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">TopRight</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-positions-bottom-row<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bottom-left<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>BL<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">BottomLeft</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bottom-center<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>BC<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">BottomCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>bottom-right<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>BR<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">BottomRight</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-positions-left-col<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>left-top<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>LT<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">LeftTop</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>left-center<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>LC<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">LeftCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>left-bottom<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>LB<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">LeftBottom</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-positions-right-col<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>right-top<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>RT<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">RightTop</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>right-center<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>RC<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">RightCenter</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>trigger<span class="token punctuation">}</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>right-bottom<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>RB<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">RightBottom</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(g)),p.createElement(x,{title:"使用 `centerArrow` 来控制气泡小三角的位置",id:"Democenterarrow",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tooltip</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Input</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">centerArrow</span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>centerArrow 为 true<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-tag<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token constant">Y</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">position</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>centerArrow 为 false<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-tag<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token constant">N</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(m)),p.createElement(x,{title:"外部控制显示隐藏",id:"Democontrolled",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Tooltip</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Button</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">NoneTriggerDemo</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n visible<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">close</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n visible<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">open</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n visible<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> content <span class="token operator">=</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>p</span> <span class="token attr-name">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> marginBottom<span class="token operator">:</span> <span class="token number">10</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>可以在 <span class="token maybe-class-name">Tooltip</span> 外部关闭<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>p</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-none-trigger-container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>content<span class="token punctuation">}</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>none<span class="token punctuation">"</span></span> <span class="token attr-name">visible</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">.</span><span class="token property-access">visible</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">open</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n 打开\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">disabled</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">.</span><span class="token property-access">visible</span><span class="token punctuation">}</span></span> <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">close</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n 外部关闭\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">NoneTriggerDemo</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(h)),p.createElement(x,{title:"禁用元素",id:"Demodisabled",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Button</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Input</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Radio</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Tooltip</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-doc-tooltip-container<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>内容<span class="token punctuation">"</span></span>\n <span class="token attr-name">fixMouseEventsOnDisabledChildren</span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span><span class="token punctuation">></span></span>\n <span class="token maybe-class-name">Button</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>内容<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Input</span></span> <span class="token attr-name">disabled</span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span> <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>内容<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Radio</span></span> <span class="token attr-name">disabled</span> <span class="token attr-name">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> marginLeft<span class="token operator">:</span> <span class="token string">\'12px\'</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tooltip</span></span>\n <span class="token attr-name">trigger</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>内容<span class="token punctuation">"</span></span>\n <span class="token attr-name">fixMouseEventsOnDisabledChildren</span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Button.Directive</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span><span class="token punctuation">"</span></span><span class="token punctuation">></span></span> <span class="token maybe-class-name">ButtonDirective</span> <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Button.Directive</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Tooltip</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(v)),p.createElement(f,{html:'<h3 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h3>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>是否必须</th>\n<th>默认值</th>\n<th>备选值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>title</td>\n<td>弹层的提示文字</td>\n<td>node</td>\n<td>是</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>trigger</td>\n<td>触发方式</td>\n<td>string</td>\n<td>否</td>\n<td><code>\'hover\'</code></td>\n<td><code>\'click\'</code>\n, \n<code>\'hover\'</code>\n, \n<code>\'focus\'</code>\n, \n<code>\'none\'</code></td>\n</tr>\n<tr>\n<td>position</td>\n<td>弹出框的位置,命名规则:相对触发元素的位置+箭头相对于Tooltip的位置。接受函数形式,参考 \n<code>Popover.Position.create</code></td>\n<td>string \n|\n func</td>\n<td>否</td>\n<td><code>\'top-center\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>centerArrow</td>\n<td>是否按小箭头居中对齐trigger来定位</td>\n<td>bool</td>\n<td>否</td>\n<td><code>false</code></td>\n<td></td>\n</tr>\n<tr>\n<td>cushion</td>\n<td>与 Popover 中的\n<code>cushion</code>\n含义(定位的偏移量)相同,通常为弹框边缘与 trigger 元素之间的距离</td>\n<td>number</td>\n<td>否</td>\n<td><code>10</code></td>\n<td></td>\n</tr>\n<tr>\n<td>containerSelector</td>\n<td>弹层渲染加载到的父节点CSS selector</td>\n<td>string</td>\n<td>否</td>\n<td><code>\'body\'</code></td>\n<td>所有合法的CSS selector</td>\n</tr>\n<tr>\n<td>visible</td>\n<td>外部维护 \n<code>Tooltip</code>\n 的显示状态,此时外部拥有 \n<code>Tooltip</code>\n 的控制权</td>\n<td>bool</td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onVisibleChange</td>\n<td>必须和 \n<code>visible</code>\n 一起使用</td>\n<td>func</td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>className</td>\n<td>自定义类名</td>\n<td>string</td>\n<td>否</td>\n<td><code>\'\'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>style</td>\n<td>自定义样式</td>\n<td>CSSProperties</td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#hong-fa-fang-shi-de-e-wai-api">¶</a><a href="javascript:void(0)" id="hong-fa-fang-shi-de-e-wai-api" class="anchor-point"></a>触发方式的额外API</h4>\n<p>根据 <code>trigger</code> 值的不同, <code>Tooltip</code> 提供了一些额外的控制参数,同<code>Pop</code>组件.</p>\n<h4 class="anchor-heading"><a href="#click">¶</a><a href="javascript:void(0)" id="click" class="anchor-point"></a>Click</h4>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>是否必须</th>\n<th>默认值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>closeOnClickOutside</td>\n<td>点击弹层和trigger节点外部时自动关闭</td>\n<td>bool</td>\n<td>否</td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#hover">¶</a><a href="javascript:void(0)" id="hover" class="anchor-point"></a>Hover</h4>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>是否必须</th>\n<th>默认值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>mouseEnterDelay</td>\n<td>hover打开的延迟(单位:毫秒)</td>\n<td>number</td>\n<td>否</td>\n<td><code>160</code></td>\n</tr>\n<tr>\n<td>mouseLeaveDelay</td>\n<td>关闭的的延迟(单位:毫秒)</td>\n<td>number</td>\n<td>否</td>\n<td><code>160</code></td>\n</tr>\n<tr>\n<td>fixMouseEventsOnDisabledChildren</td>\n<td>对禁用的 Input/Button 做鼠标事件的兼容处理</td>\n<td>boolean</td>\n<td>否</td>\n<td><code>false</code></td>\n</tr>\n</tbody>\n</table>\n<p><strong>注意:</strong><code>fixMouseEventsOnDisabledChildren</code> 仅对 Zent 组件有效。</p>\n<p>背景</p>\n<ul>\n<li><a href="https://github.com/youzan/zent/issues/142">原生 <code>input</code> 和 <code>button</code> 在 disabled 状态下触发鼠标事件失效</a></li>\n</ul>\n<p>解决方案</p>\n<ul>\n<li>先将元素 <code>input</code> 或 <code>button</code> 包裹在另一元素内部</li>\n<li>再给元素 <code>input</code> 或 <code>button</code> 加样式 <code>{pointer-events: none}</code></li>\n</ul>\n<h4 class="anchor-heading"><a href="#none">¶</a><a href="javascript:void(0)" id="none" class="anchor-point"></a>None</h4>\n<p>这种模式下 需要使用者自己在回调中控制 <code>visible</code> 来关闭 <code>Tooltip</code>.</p>'}))}}},4246:(n,s,a)=>{"use strict";a.d(s,{E:()=>i});var t=a(59312),p=a(24246),o=a(60042),e=a.n(o),c=a(27378),l=a(57961),u=a(1348);function i(n){var s=(0,c.useContext)(u.d),a=n.value,o=n.disabled,i=void 0===o?s.value:o,k=n.readOnly,r=void 0!==k&&k,d=n.isValueEqual,g=void 0===d?Object.is:d,m=n.className,h=n.style,v=n.children,b=n.onChange,f=(0,c.useMemo)((function(){return{value:a,disabled:i,readOnly:r,isValueEqual:g,onRadioChange:b}}),[a,i,r,g,b]);return(0,p.jsx)(l.Z.Provider,(0,t.pi)({value:f},{children:(0,p.jsx)("div",(0,t.pi)({className:e()("zent-radio-group",m),style:h,"data-zv":"9.12.16"},{children:v}),void 0)}),void 0)}s.Z=i},57961:(n,s,a)=>{"use strict";var t=(0,a(27378).createContext)(null);t.displayName="RadioGroupContext",s.Z=t},71457:(n,s,a)=>{"use strict";a.d(s,{Y:()=>g,Z:()=>m});var t=a(59312),p=a(24246),o=a(60042),e=a.n(o),c=a(1535),l=a(27378);function u(n,s){var a=(0,l.useRef)(s);a.current=s;var p=n&&n.onRadioChange;return(0,l.useCallback)((function(n){var s=function(n,s){var a=Object.create(n);return a.target=(0,t.pi)((0,t.pi)({},s),{type:"radio",checked:n.target.checked}),a}(n,a.current);if(p)p(s);else{var o=a.current.onChange;o&&o(s)}}),[p])}function i(n,s,a){var t=function(n,s,a){return"boolean"==typeof a.disabled?a.disabled:s&&"boolean"==typeof s.disabled?s.disabled:n.value}(n,s,a),p=function(n,s){return"boolean"==typeof s.readOnly?s.readOnly:!!n&&n.readOnly}(s,a);return{checked:s?s.isValueEqual(s.value,a.value):!!a.checked,disabled:t,readOnly:p}}var k=a(4246),r=a(1348),d=a(57961);function g(n){var s=n.className,a=n.style,o=n.children,k=(n.value,n.width),g=n.labelStyle,m=(n.onMouseEnter,n.onMouseLeave,(0,t._T)(n,["className","style","children","value","width","labelStyle","onMouseEnter","onMouseLeave"])),h=(0,l.useContext)(r.d),v=(0,l.useContext)(d.Z),b=i(h,v,n),f=b.checked,y=b.disabled,j=b.readOnly,x=u(v,n),z=e()(s,"zent-radio-wrap",{"zent-radio-checked":!!f,"zent-radio-disabled":y||j}),T=(0,c.Z)(k),w=(0,t.pi)((0,t.pi)({},a),T);return(0,p.jsxs)("label",(0,t.pi)({className:z,style:w,onMouseEnter:n.onMouseEnter,onMouseLeave:n.onMouseLeave,"data-zv":"9.12.16"},{children:[(0,p.jsxs)("span",(0,t.pi)({className:"zent-radio","data-zv":"9.12.16"},{children:[(0,p.jsx)("span",{className:"zent-radio-inner","data-zv":"9.12.16"},void 0),(0,p.jsx)("input",(0,t.pi)({},m,{type:"radio",checked:!!f,disabled:y,readOnly:j,onChange:x,"data-zv":"9.12.16"}),void 0)]}),void 0),void 0!==o&&(0,p.jsx)("span",(0,t.pi)({className:"zent-radio-label",style:g,"data-zv":"9.12.16"},{children:o}),void 0)]}),void 0)}g.Button=function(n){var s=n.className,a=n.style,o=n.children,k=(n.value,n.width),g=n.onMouseEnter,m=n.onMouseLeave,h=(0,t._T)(n,["className","style","children","value","width","onMouseEnter","onMouseLeave"]),v=(0,l.useContext)(r.d),b=(0,l.useContext)(d.Z);if(!b)throw new Error("Radio.Button must be nested within Radio.Group");var f=i(v,b,n),y=f.checked,j=f.disabled,x=f.readOnly,z=u(b,n),T=e()(s,"zent-radio-button",{"zent-radio-button--checked":!!y,"zent-radio-button--disabled":j||x}),w=(0,c.Z)(k),B=(0,t.pi)((0,t.pi)({},a),w);return(0,p.jsxs)("label",(0,t.pi)({className:T,style:B,onMouseEnter:g,onMouseLeave:m,"data-zv":"9.12.16"},{children:[(0,p.jsx)("input",(0,t.pi)({},h,{type:"radio",checked:!!y,disabled:j,readOnly:x,onChange:z,"data-zv":"9.12.16"}),void 0),(0,p.jsx)("span",(0,t.pi)({className:"zent-radio-button__content","data-zv":"9.12.16"},{children:o}),void 0)]}),void 0)},g.Group=k.Z;var m=g},57097:(n,s,a)=>{"use strict";a.d(s,{u:()=>d});var t=a(59312),p=a(24246),o=a(27378),e=a(60042),c=a.n(e),l=a(42690),u=a(33806),i=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return(0,t.ZT)(s,n),s}(u.ZP.Trigger.Base),k=a(50707),r=u.ZP.Trigger,d=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.popoverRef=(0,o.createRef)(),s}return(0,t.ZT)(s,n),s.prototype.renderContent=function(){var n=this.props.title;return(0,p.jsxs)(u.ZP.Content,{children:[(0,p.jsx)("div",(0,t.pi)({className:"zent-tooltip-v2-inner","data-zv":"9.12.16"},{children:n}),void 0),(0,p.jsx)("i",{className:"zent-tooltip-v2-arrow","data-zv":"9.12.16"},void 0)]},void 0)},s.prototype.renderTrigger=function(){var n=this.props.children;if("click"===this.props.trigger){var s=this.props.closeOnClickOutside,a=void 0===s||s;return(0,p.jsx)(r.Click,(0,t.pi)({closeOnClickOutside:a},{children:n}),void 0)}if("hover"===this.props.trigger){var o=this.props,e=o.mouseLeaveDelay,c=void 0===e?200:e,l=o.mouseEnterDelay,u=void 0===l?200:l,k=o.anchorOnly,d=o.fixMouseEventsOnDisabledChildren;return(0,p.jsx)(r.Hover,(0,t.pi)({showDelay:u,hideDelay:c,anchorOnly:k,fixMouseEventsOnDisabledChildren:d},{children:n}),void 0)}return"focus"===this.props.trigger?(0,p.jsx)(r.Focus,{children:n},void 0):"none"===this.props.trigger?(0,p.jsx)(i,{children:n},void 0):null},s.prototype.render=function(){var n=this.props,s=n.className,a=n.trigger,o=n.visible,e=n.position,i=n.cushion,r=n.centerArrow,d=n.containerSelector,g=n.style,m=c()("zent-tooltip-v2",s),h=this.props.onVisibleChange;return"none"===a&&(h=h||l.Z),(0,p.jsxs)(u.ZP,(0,t.pi)({visible:o,onVisibleChange:h,className:m,cushion:i,position:(0,k.Z)(e,r),containerSelector:d,ref:this.popoverRef,style:g},{children:[this.renderTrigger(),this.renderContent()]}),void 0)},s.defaultProps={trigger:"hover",position:"top-center",cushion:10,centerArrow:!1,containerSelector:"body"},s}(o.Component)},1535:(n,s,a)=>{"use strict";function t(n){return"string"==typeof n||"number"==typeof n?{width:n}:{}}a.d(s,{Z:()=>t})}}]);