text: /*
   * maxrow v1.1.3
   * (c) 2021 Little Linghuan & Esone
   * Released under the GPL license
   * ieexx.com
   */
  
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).maxrow=t()}(this,function(){"use strict";return class{constructor(e){this.selector=e.selector,this.row=e.row||3,this.dialog=e.dialog||(e=>alert(e)),this.textStorage=[""],this.editArea=this.createDom(),this.addEvents()}setText(e){this.editArea.innerText=e,this.textStorage.push(e)}createDom(){let e=document.createElement("div");return e.style.outline="none",e.setAttribute("contenteditable",!0),document.querySelector(this.selector).appendChild(e),this.editAreaLineHeight=parseInt(getComputedStyle(e).lineHeight),e}addEvents(){let i=this;this.editArea.onkeyup=function(e){var t=this.innerText;this.offsetHeight>i.editAreaLineHeight*i.row?(this.innerText=i.textStorage.pop(),this.blur(),i.dialog(`超出了,最多${i.row}行哦～～`)):i.textStorage.push(t)},this.editArea.onkeydown=function(e){e=e.keyCode||e.which;if(this.offsetHeight>i.editAreaLineHeight*i.row&&(48<=e||13==e))return!1},this.editArea.onblur=function(e){this.innerText,this.offsetHeight>i.editAreaLineHeight*i.row&&(this.innerText=i.textStorage.pop(),this.blur(),i.dialog(`超出了,最多${i.row}行哦～～`))}}}});