(this.webpackJsonpstreamlit_sentence_selector=this.webpackJsonpstreamlit_sentence_selector||[]).push([[0],{12:function(e,t,n){e.exports=n(20)},20:function(e,t,n){"use strict";n.r(t);var c=n(4),r=n.n(c),a=n(10),s=n.n(a),o=n(1),i=n(2),l=n(3),u=n(8);function d(e){var t=e||{},n=t.handleClickThisEle,a=t.selectArr,s=t.item,o=t.isSelected,u=Object(c.useState)(!1),d=Object(l.a)(u,2),b=d[0],p=d[1],j={background:"lightblue"},m={background:"lightskyblue"},O={};function f(e){"enter"===e?p(!0):"leave"===e&&p(!1)}return o&&b?O=Object(i.a)(Object(i.a)(Object(i.a)({},j),m),{},{cursor:"pointer"}):o&&!b?O=Object(i.a)(Object(i.a)({},m),{},{cursor:"pointer"}):!o&&b?O=Object(i.a)(Object(i.a)({},j),{},{cursor:"pointer"}):o||b||(O={cursor:"pointer"}),r.a.createElement("span",{onClick:function(){return n(s)},onMouseEnter:function(){return f("enter")},onMouseLeave:function(){return f("leave")},className:a.includes(s)?"selected":"",style:Object(i.a)(Object(i.a)({},O),{},{border:"1px #cdcdcd solid",marginRight:"3px",borderRadius:"4px"})},s)}var b=Object(u.b)((function(e){var t=e.args;u.a.setComponentReady();var n=t.sentences,a=Object(c.useState)([]),s=Object(l.a)(a,2),i=s[0],b=s[1],p=Object(c.useState)({}),j=Object(l.a)(p,2);function m(e){var t=[];t=i.includes(e)?i.filter((function(t){return t!==e})):[].concat(Object(o.a)(i),[e]),b(t),console.log("\u4f60\u9009\u62e9\u7684\u8bed\u53e5\u6709 => ",Object(o.a)(t)),u.a.setComponentValue(Object(o.a)(t))}return j[0],j[1],Object(c.useEffect)((function(){u.a.setFrameHeight()})),r.a.createElement("div",{className:"tag"},r.a.createElement("span",{className:"sentence",style:{lineHeight:"30px",height:"30px",padding:"2px",borderRadius:"4px",cursor:"pointer",transitionProperty:"all"}},null===n||void 0===n?void 0:n.map((function(e,t){return r.a.createElement(d,{key:t,selectArr:i,item:e,isSelected:i.includes(e),handleClickThisEle:m,style:{border:"1px #cdcdcd solid"}})}))))}));s.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(b,null)),document.getElementById("root"))}},[[12,1,2]]]);
//# sourceMappingURL=main.fa687adc.chunk.js.map