wxs-pdf-print
Version:
wxs-pdf-print for Vue2.x / Vue3.x 支持拖拽(分页(不分页)、表头表脚、样式设置、复制粘贴、缩放、撤销重做)生成打印模板、导出json模板数据、静默打印/获取MAC地址(借助客户端)
1 lines • 619 kB
JavaScript
((t,e)=>{"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery"),require("jsbarcode"),require("socket.io-client"),require("jspdf"),require("canvg")):"function"==typeof define&&define.amd?define("wxs-pdf-print",["jquery","jsbarcode","socket.io-client","jspdf","canvg"],e):"object"==typeof exports?exports["wxs-pdf-print"]=e(require("jquery"),require("jsbarcode"),require("socket.io-client"),require("jspdf"),require("canvg")):t["wxs-pdf-print"]=e(t.jQuery,t.JsBarcode,t.io,t.jspdf,t.canvg)})(window,function(__WEBPACK_EXTERNAL_MODULE__0__,__WEBPACK_EXTERNAL_MODULE__4__,__WEBPACK_EXTERNAL_MODULE__8__,__WEBPACK_EXTERNAL_MODULE__9__,__WEBPACK_EXTERNAL_MODULE__10__){return(i=>{var n={};function o(t){var e;return(n[t]||(e=n[t]={i:t,l:!1,exports:{}},i[t].call(e.exports,e,e.exports,o),e.l=!0,e)).exports}return o.m=i,o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/dist/",o(o.s=12)})([function(t,e){t.exports=__WEBPACK_EXTERNAL_MODULE__0__},function(module,__webpack_exports__,__webpack_require__){!function(jQuery){__webpack_require__.d(__webpack_exports__,"b",function(){return hiprint}),__webpack_require__.d(__webpack_exports__,"a",function(){return defaultElementTypeProvider});var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),_claviska_jquery_minicolors_jquery_minicolors_min__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(13),_claviska_jquery_minicolors_jquery_minicolors_min__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_claviska_jquery_minicolors_jquery_minicolors_min__WEBPACK_IMPORTED_MODULE_1__),jsbarcode__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(4),jsbarcode__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(jsbarcode__WEBPACK_IMPORTED_MODULE_2__),_plugins_qrcode_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(14),_plugins_qrcode_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_plugins_qrcode_js__WEBPACK_IMPORTED_MODULE_3__),_plugins_watermark_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(3),socket_io_client__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(8),socket_io_client__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(socket_io_client__WEBPACK_IMPORTED_MODULE_5__),_css_image_l_img_svg__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(5),_css_image_v_img_svg__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(15),jspdf__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(9),jspdf__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(jspdf__WEBPACK_IMPORTED_MODULE_8__),nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(2),nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9__),canvg__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(10),canvg__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(canvg__WEBPACK_IMPORTED_MODULE_10__),_etypes_default_etyps_provider__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(11);function _instanceof(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}window.$=window.jQuery=jquery__WEBPACK_IMPORTED_MODULE_0___default.a,window.autoConnect=!0,window.io=socket_io_client__WEBPACK_IMPORTED_MODULE_5__.io;var hiprint=(i=>{var n={};function o(t){var e;return(n[t]||(e=n[t]={i:t,l:!1,exports:{}},i[t].call(e.exports,e,e.exports,o),e.l=!0,e)).exports}return o.m=i,o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==_typeof(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/",o(o.s=21)})([function(t,e,i){var r;i.d(e,"a",function(){return hinnn}),window.hinnn={},hinnn.event=(r={},{on:function(t,e){r[t]||(r[t]=[]),r[t].push(e)},id:0,off:function(t,e){var i=r[t];if(i){for(var n=-1,o=0;o<i.length;o++)if(i[o]===e){n=o;break}n<0||r[t].splice(n,1)}},trigger:function(t){var e=r[t];if(e&&e.length)for(var i=Array.prototype.slice.call(arguments,1),n=0;n<e.length;n++)e[n].apply(this,i)},clear:function(t){r[t]=[]},getId:function(){return this.id+=1,this.id},getNameWithId:function(t){return t+"-"+this.getId()}}),hinnn.form={serialize:function(t){var t=jquery__WEBPACK_IMPORTED_MODULE_0___default()(t).serializeArray(),e={};return jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(t,function(){e[this.name]?"[object Array]"==Object.prototype.toString.call(e[this.name])?e[this.name].push(this.value):e[this.name]=[e[this.name],this.value]:e[this.name]=this.value}),e}},hinnn.pt={toPx:function(t){return t*(this.getDpi()/72)},toMm:function(t){return hinnn.px.toMm(hinnn.pt.toPx(t))},dpi:0,getDpi:function(){var t;return this.dpi||((t=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),this.dpi=t.offsetHeight),this.dpi}},hinnn.px={toPt:function(t){return t*(72/this.getDpi())},toMm:function(t){return Math.round(t/this.getDpi()*25.4*100)/100},dpi:0,getDpi:function(){var t;return this.dpi||((t=document.createElement("DIV")).style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(t),this.dpi=t.offsetHeight),this.dpi}},hinnn.mm={toPt:function(t){return 72/25.4*t},toPx:function(t){return hinnn.pt.toPx(hinnn.mm.toPt(t))}},hinnn.throttle=function(i,n,o){function r(){d=!1===o.leading?0:_.now(),l=null,p=i.apply(a,s),l||(a=s=null)}var a,s,p,l=null,d=0;o=o||{};return function(){var t=_.now(),e=(d||!1!==o.leading||(d=t),n-(t-d));return a=this,s=arguments,e<=0||n<e?(l&&(clearTimeout(l),l=null),d=t,p=i.apply(a,s),l||(a=s=null)):l||!1===o.trailing||(l=setTimeout(r,e)),p}},hinnn.debounce=function(e,i,n){function o(){var t=_.now()-p;t<i&&0<=t?r=setTimeout(o,i-t):(r=null,n||(l=e.apply(s,a),r)||(s=a=null))}var r,a,s,p,l;return function(){s=this,a=arguments,p=_.now();var t=n&&!r;return r=r||setTimeout(o,i),t&&(l=e.apply(s,a),s=a=null),l}},hinnn.toUtf8=function(t){for(var e,i="",n=t.length,o=0;o<n;o++)1<=(e=t.charCodeAt(o))&&e<=127?i+=t.charAt(o):(2047<e?i=(i+=String.fromCharCode(224|e>>12&15))+String.fromCharCode(128|e>>6&63):i+=String.fromCharCode(192|e>>6&31),i+=String.fromCharCode(128|e>>0&63));return i},hinnn.groupBy=function(t,n,o){var r={};return t.forEach(function(e){var i=JSON.stringify(o(e));r[i]||(r[i]={rows:[]},n.forEach(function(t){r[i][t]=e[t]})),r[i].rows.push(e)}),Object.keys(r).map(function(t){return r[t]})},hinnn.orderBy=function(t,e){if(t.length<=1)return t;var i=Math.floor(t.length/2),n=t.splice(i,1)[0],o=[],r=[],a=!0,i=!1,s=void 0;try{for(var p,l=t[Symbol.iterator]();!(a=(p=l.next()).done);a=!0){var d=p.value;(e(d)<e(n)?o:r).push(d)}}catch(t){i=!0,s=t}finally{try{a||null==l.return||l.return()}finally{if(i)throw s}}return this.orderBy(o,e).concat([n],this.orderBy(r,e))},hinnn.dateFormat=function(t,e){if(t)try{var i,n="string"==typeof t?new Date(t):t,o={"M+":n.getMonth()+1,"d+":n.getDate(),"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};for(i in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(n.getFullYear()+"").substr(4-RegExp.$1.length))),o)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?o[i]:("00"+o[i]).substr((""+o[i]).length)));return e}catch(t){}return""},hinnn.numFormat=function(t,e){if(null!=t)try{var i="string"==typeof t?parseFloat(t):t,n=parseInt(e);return 0<n?i.toFixed(n):parseInt(i.toString())}catch(t){}return""},hinnn.toUpperCase=function(t,e){if(!nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a)return e;var i=e;switch(t){case"0":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.encodeS(e);break;case"1":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.encodeS(e,{tenMin:!1});break;case"2":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.encodeB(e,{tenMin:!0});break;case"3":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.encodeB(e);break;case"4":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.toMoney(e,{tenMin:!0});break;case"5":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.toMoney(e);break;case"6":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.toMoney(e,{complete:!0});break;case"7":i=nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_9___default.a.cn.toMoney(e,{complete:!0,outSymbol:!1})}return i}},function(t,e,i){i.d(e,"a",function(){return o});var n=i(9),o=(r.prototype.init=function(t){t&&jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(this,t)},r.prototype.on=function(t,e){hinnn.event.on(t,e)},r.prototype.clear=function(t){hinnn.event.clear(t)},r.prototype.registerItems=function(t){t.forEach(function(t){n.a.registerItem(new t)})},Object.defineProperty(r,"instance",{get:function(){return r._instance||(r._instance=new r,window.HIPRINT_CONFIG&&jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(r._instance,HIPRINT_CONFIG),r._instance.optionItems&&r._instance.optionItems.forEach(function(t){n.a.registerItem(new t)})),r._instance},enumerable:!0,configurable:!0}),r);function r(){}},function(t,e,i){o.prototype.updatePosition=function(t,e){this.left=t,this.top=e};var n=o;function o(t){this.printElement=t}i.d(e,"a",function(){return r});Object.defineProperty(a,"instance",{get:function(){return this._instance||(this._instance=new a),this._instance},enumerable:!0,configurable:!0}),a.prototype.getDragingPrintElement=function(){return a.instance.dragingPrintElement},a.prototype.setDragingPrintElement=function(t){a.instance.dragingPrintElement=new n(t)},a.prototype.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},a.prototype.imageToBase64=function(t){if(-1==jquery__WEBPACK_IMPORTED_MODULE_0___default()(t).attr("src").indexOf("base64"))try{var e=document.createElement("canvas"),i=new Image;i.src=t.attr("src"),e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),t.attr("src",e.toDataURL("image/png"))}catch(e){try{this.xhrLoadImage(t)}catch(t){}}},a.prototype.xhrLoadImage=function(t){},a.prototype.transformImg=function(t){var i=this;t.map(function(t,e){i.imageToBase64(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e))})},a.prototype.getPrintTemplateById=function(t){return a.instance.printTemplateContainer[t]},a.prototype.setPrintTemplateById=function(t,e){return a.instance.printTemplateContainer[t]=e};var r=a;function a(){this.printTemplateContainer={},this.A1={width:841,height:594},this.A2={width:420,height:594},this.A3={width:420,height:297},this.A4={width:210,height:297},this.A5={width:210,height:148},this.A6={width:105,height:148},this.A7={width:105,height:74},this.A8={width:52,height:74},this.B1={width:1e3,height:707},this.B2={width:500,height:707},this.B3={width:500,height:353},this.B4={width:250,height:353},this.B5={width:250,height:176},this.B6={width:125,height:176},this.B7={width:125,height:88},this.B8={width:62,height:88},this.dragLengthCNum=function(t,e){return Math.round(.75*t/e)*e}}},function(t,e,i){var o=function(){},n=(i.d(e,"a",function(){return n}),r.prototype.setDefault=function(t){this.defaultOptions=t,this.initSize()},r.prototype.initSize=function(){this.width||this.setWidth(this.defaultOptions.width),this.height||this.setHeight(this.defaultOptions.height)},r.prototype.initSizeByHtml=function(t,e){this.width||this.setWidth(t),this.height||this.setHeight(e)},r.prototype.getRectInfo=function(){var t,e,i,n,o,r,a={w:0,h:0,diffW:0,diffH:0};return this.transform&&(e=this.transform*Math.PI/180,n=this.width,t=this.height,r=Math.sin(e),e=Math.cos(e),o=(n-(i=Math.abs(n*e)+Math.abs(t*r)))/2,r=(t-(n=Math.abs(n*r)+Math.abs(t*e)))/2,a.w=i,a.h=n,a.diffW=o,a.diffH=r),a},r.prototype.getLeft=function(){return this.left},r.prototype.posLeft=function(){var t=this.left;return this.transform&&(t+=this.getRectInfo().diffW),Math.floor(10*t)/10},r.prototype.setRotate=function(t){null!=t&&(this.transform=t)},r.prototype.displayLeft=function(t){return this.transform&&t?this.left+this.getRectInfo().diffW+"pt":this.left+"pt"},r.prototype.setLeft=function(t){null!=t&&(this.left=t)},r.prototype.getTop=function(){return this.top},r.prototype.posTop=function(){var t=this.top;return this.transform&&(t+=this.getRectInfo().diffH),Math.floor(10*t)/10},r.prototype.getTopInDesign=function(){return this.topInDesign},r.prototype.displayTop=function(t){return this.transform&&t?this.top+this.getRectInfo().diffH+"pt":this.top+"pt"},r.prototype.setTop=function(t){null!=t&&(this.top=t)},r.prototype.copyDesignTopFromTop=function(){this.topInDesign=this.top},r.prototype.getHeight=function(){var t;return this.transform?(t=this.getRectInfo()).h+t.diffH:this.height},r.prototype.displayHeight=function(){return this.height+"pt"},r.prototype.setHeight=function(t){null!=t&&(this.height=t)},r.prototype.getWidth=function(){var t;return this.transform?(t=this.getRectInfo()).w+t.diffW:this.width},r.prototype.displayWidth=function(){return this.width+"pt"},r.prototype.setWidth=function(t){null!=t&&(this.width=t)},r.prototype.getValueFromOptionsOrDefault=function(t){return(null==this[t]?this.defaultOptions:this)[t]},r.prototype.getPrintElementOptionEntity=function(){var i=new o,n=this;return Object.keys(this).filter(function(t){return"topInDesign"!=t}).forEach(function(t){var e;"number"!=typeof n[t]&&"string"!=typeof n[t]&&!["fields"].includes(t)&&_typeof(n[t])!=_typeof(!0)||(i[t]=n[t]),"style"==t&&(i.style={},e=n[t])&&Object.keys(e).forEach(function(t){"number"!=typeof e[t]&&"string"!=typeof e[t]||(i.style[t]=e[t])})}),i},r.prototype.init=function(e){var i=this;e&&Object.keys(e).forEach(function(t){i[t]=e[t]})},r);function r(t){this.left=(t=t||{}).left,this.top=t.top,this.topInDesign=this.top,this.height=t.height,this.width=t.width,this.transform=t.transform,this.init(t)}},function(module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,"a",function(){return BasePrintElement});var _entity_PrintElementEntity__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(17),_HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),_print_element_option_PrintElementOptionItemManager__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9),_dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6),_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(0),_PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(8),_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(2),BasePrintElement=function(){function BasePrintElement(t){this.printElementType=t,this.id=_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.guid()}return BasePrintElement.prototype.getConfigOptionsByName=function(t){return _HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__.a.instance[t]},BasePrintElement.prototype.getProxyTarget=function(t){t&&this.SetProxyTargetOption(t);var t=this.getData(),e=this.createTarget(this.getTitle(),t);return this.updateTargetSize(e),this.css(e,t),e},BasePrintElement.prototype.SetProxyTargetOption=function(t){this.options.getPrintElementOptionEntity(),jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(this.options,t),this.copyFromType()},BasePrintElement.prototype.showInPage=function(t,e){var i=this.options.showInPage,n=this.options.unShowInPage;if(i){if("first"==i)return 0==t;if(t==e-1&&"last"==n)return!1;if("odd"==i)return(0!=t||"first"!=n)&&t%2==0;if("even"==i)return t%2==1;if("last"==i)return t==e-1}return!(0==t&&"first"==n||t==e-1&&"last"==n)},BasePrintElement.prototype.setTemplateId=function(t){this.templateId=t},BasePrintElement.prototype.setPanel=function(t){this.panel=t},BasePrintElement.prototype.getField=function(){return this.options.field||this.printElementType.field},BasePrintElement.prototype.getColumnField=function(){let e={};return this.options.fields&&this.options.fields.length&&this.options.fields.forEach(t=>{e[t.field]="*"}),[e]},BasePrintElement.prototype.getTitle=function(){return this.printElementType.title},BasePrintElement.prototype.updateSizeAndPositionOptions=function(t,e,i,n){this.options.setLeft(t),this.options.setTop(e),this.options.copyDesignTopFromTop(),this.options.setWidth(i),this.options.setHeight(n)},BasePrintElement.prototype.initSizeByHtml=function(t){t&&t.length&&(this.createTempContainer(),t=t.clone(),this.getTempContainer().append(t),this.options.initSizeByHtml(parseInt(_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.px.toPt(t.width()).toString()),parseInt(_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.px.toPt(t.height()).toString())),this.removeTempContainer())},BasePrintElement.prototype.updateTargetSize=function(t){t.css("width",this.options.displayWidth()),t.css("height",this.options.displayHeight())},BasePrintElement.prototype.updateTargetWidth=function(t){t.css("width",this.options.displayWidth())},BasePrintElement.prototype.getDesignTarget=function(t){var e=this,i=0;return this.designTarget=this.getHtml(t)[0].target,this.designPaper=t,this.designTarget.click(function(t){500<t.timeStamp-i&&_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger(e.getPrintElementSelectEventKey(),{printElement:e}),i=t.timeStamp}),this.designTarget.dblclick(function(t){return!1}),this.designTarget},BasePrintElement.prototype.selectEnd=function(t){var e,i;t.focus(),void 0!==window.getSelection&&void 0!==document.createRange?((i=document.createRange()).selectNodeContents(t[0]),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):void 0!==document.body.createTextRange&&((i=document.body.createTextRange()).moveToElementText(t[0]),i.collapse(!1),i.select())},BasePrintElement.prototype.updateByContent=function(t){var e,i=this,n=i.designTarget.find(".hiprint-printElement-content");i._editing&&(n&&n.css("cursor","")&&n.removeClass("editing")&&n.removeAttr("contenteditable"),i.designTarget.removeClass("editing"),n=n.text(),e=i.options.title+":",n.startsWith(e)&&i.options.field?n.length>e.length?i.options.testData=n.split(":")[1]:(i.options.title=n,i.options.testData=""):i.options.title=n,t||_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger(i.getPrintElementSelectEventKey(),{printElement:i}),i.updateDesignViewFromOptions(),_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+i.templateId,"编辑修改"),i._editing=!1,e=null==i.options.draggable||1==i.options.draggable,i.designTarget.hidraggable("update",{draggable:e}))},BasePrintElement.prototype.getPrintElementSelectEventKey=function(){return"PrintElementSelectEventKey_"+this.templateId},BasePrintElement.prototype.design=function(t,p){var l=this;this.designTarget.hidraggable({draggable:l.options.draggable,axis:l.options.axis||void 0,designTarget:l,onDrag:function(t,e,i){var n,o,r=l.panel.printElements.filter(function(t){return"block"==t.designTarget.children().last().css("display")&&t.designTarget.children().last().hasClass("selected")&&!t.printElementType.type.includes("table")}),a=1<r.length,s=!l.designTarget.children().last().hasClass("selected");a&&(n=e-l.options.left,o=i-l.options.top,r.forEach(function(t){t.updateSizeAndPositionOptions(n+t.options.getLeft(),o+t.options.getTop()),t.designTarget.css("left",t.options.displayLeft()),t.designTarget.css("top",t.options.displayTop()),t.createLineOfPosition(p)}),!s)||(l.updateSizeAndPositionOptions(e,i),l.createLineOfPosition(p)),_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.changed=!0},moveUnit:"pt",minMove:_HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__.a.instance.movingDistance,onBeforeDrag:function(t){_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging=!0,l.designTarget.focus(),l.createLineOfPosition(p)},getScale:function(){return l.designPaper.scale||1},onStopDrag:function(t){_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.changed&&_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+l.templateId,"移动"),_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging=!1,_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.changed=!1;var e=l.panel.printElements.filter(function(t){return"block"==t.designTarget.children().last().css("display")&&!t.printElementType.type.includes("table")});1<e.length?e.forEach(function(t){t.removeLineOfPosition()}):l.removeLineOfPosition()}}),this.setResizePanel(),this.bingCopyEvent(this.designTarget),this.bingKeyboardMoveEvent(this.designTarget,p)},BasePrintElement.prototype.getPrintElementEntity=function(t){return t?new _entity_PrintElementEntity__WEBPACK_IMPORTED_MODULE_0__.a(void 0,this.options.getPrintElementOptionEntity(),this.printElementType.getPrintElementTypeEntity()):new _entity_PrintElementEntity__WEBPACK_IMPORTED_MODULE_0__.a(this.printElementType.tid,this.options.getPrintElementOptionEntity())},BasePrintElement.prototype.submitOption=function(){var o=this,t=this.getConfigOptions();t&&t.tabs&&t.tabs.length?this.getPrintElementOptionTabs().forEach(function(t){t.list.forEach(function(t){var e=t.getValue(),i="textType"==t.name&&o.options[t.name]!==e,n="axis"==t.name&&o.options[t.name]!==e;e&&"object"==_typeof(e)?Object.keys(e).forEach(function(t){o.options[t]=e[t]}):o.options[t.name]=e,i&&o.setResizePanel(),n&&o.designTarget.hidraggable("update",{axis:e})})}):this.getPrintElementOptionItems().forEach(function(t){var e=t.getValue(),i="textType"==t.name&&o.options[t.name]!==e,n="axis"==t.name&&o.options[t.name]!==e;e&&"object"==_typeof(e)?Object.keys(e).forEach(function(t){o.options[t]=e[t]}):o.options[t.name]=e,i&&o.setResizePanel(),n&&o.designTarget.hidraggable("update",{axis:e})}),this.updateDesignViewFromOptions(),_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+this.templateId,"元素修改")},BasePrintElement.prototype.updateOption=function(t,e,i){try{var n=this.getConfigOptions(),o=[];n&&n.tabs&&n.tabs.length?n.tabs.forEach(function(t){t.options.forEach(function(t){o.push(t.name)})}):o=n.supportOptions.map(function(t){return t.name}),o&&o.includes(t)&&(this.options[t]=e,this.updateDesignViewFromOptions(),i||_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+this.templateId,"参数修改"))}catch(n){}},BasePrintElement.prototype.getReizeableShowPoints=function(){return["barcode","qrcode"].includes(this.options.textType)?["se","r"]:["s","e","r"]},BasePrintElement.prototype.setResizePanel=function(){var a=this,s=this.designPaper;this.designTarget.hireizeable({showPoints:a.getReizeableShowPoints(),draggable:a.options.draggable,showSizeBox:_HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__.a.instance.showSizeBox,getScale:function(){return a.designPaper.scale||1},onBeforeResize:function(){_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging=!0},onResize:function(t,e,i,n,o,r){null!=r?a.onRotate(t,r):a.onResize(t,e,i,n,o),a.createLineOfPosition(s)},onStopResize:function(t){_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+a.templateId,t?"旋转":"大小"),_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging=!1,a.removeLineOfPosition()}})},BasePrintElement.prototype.onRotate=function(t,e){this.options.setRotate(e)},BasePrintElement.prototype.onResize=function(t,e,i,n,o){this.updateSizeAndPositionOptions(o,n,i,e)},BasePrintElement.prototype.getOrderIndex=function(){return this.options.getTop()},BasePrintElement.prototype.getHtml=function(t,e,i){this.setCurrenttemplateData(e);var n=[],o=this.getBeginPrintTopInPaperByReferenceElement(t),r=t.getPaperFooter(0),r=(this.isHeaderOrFooter()||this.isFixed()||r<o&&"none"!=t.panelPageRule&&(n.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:void 0,printLine:void 0})),o=o-r+t.paperHeader,t.getPaperFooter(1)),this.getData(e)),i=this.createTarget(this.getTitle(),r,i);return this.updateTargetSize(i),this.css(i,r),i.css("position","absolute"),i.css("left",this.options.displayLeft()),i.css("top",o+"pt"),n.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:i,printLine:o+this.options.getHeight(),referenceElement:new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({top:this.options.getTop(),left:this.options.getLeft(),height:this.options.getHeight(),width:this.options.getWidth(),beginPrintPaperIndex:t.index,bottomInLastPaper:o+this.options.getHeight(),printTopInPaper:o})})),e&&this.options.pageBreak&&(n[0].target.css("top",t.paperHeader+"pt"),n[0].referenceElement.top=this.options.getTop()-this.options.getHeight()-t.paperHeader,n[0].printLine=t.paperHeader,n[0].referenceElement.bottomInLastPaper=0,n[0].referenceElement.printTopInPaper=t.paperHeader,n.unshift(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:i,printLine:t.height,referenceElement:new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({top:0,left:0,height:0,width:0,beginPrintPaperIndex:t.index,bottomInLastPaper:t.height,printTopInPaper:t.paperHeader})}))),n},BasePrintElement.prototype.getHtml2=function(t,e,i){var n=0,o=(this.setCurrenttemplateData(e),[]),r=this.getBeginPrintTopInPaperByReferenceElement(t),a=t.getPaperFooter(n),n=(this.isHeaderOrFooter()||this.isFixed()||("none"!=t.panelPageRule&&a<r&&(o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:void 0,printLine:void 0})),r=r-a+t.paperHeader,a=t.getPaperFooter(++n)),r<=a&&e&&r+this.options.getHeight()>a&&"none"!=t.panelPageRule&&(o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:void 0,printLine:void 0})),r=t.paperHeader,a=t.getPaperFooter(++n))),this.getData(e)),s=this.createTarget(this.getTitle(),n);return"none"==t.panelPageRule&&r+this.options.getHeight()>a&&this.updatePanelHeight(r+this.options.getHeight(),t),this.updateTargetSize(s),this.css(s,n),s.css("position","absolute"),s.css("left",this.options.displayLeft()),s.css("top",r+"pt"),o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:s,printLine:r+this.options.getHeight(),referenceElement:new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({top:this.options.getTop(),left:this.options.getLeft(),height:this.options.getHeight(),width:this.options.getWidth(),beginPrintPaperIndex:t.index,bottomInLastPaper:r+this.options.getHeight(),printTopInPaper:r})})),e&&this.options.pageBreak&&(o[0].target.css("top",t.paperHeader+"pt"),o[0].referenceElement.top=this.options.getTop()-this.options.getHeight()-t.paperHeader,o[0].printLine=t.paperHeader,o[0].referenceElement.bottomInLastPaper=0,o[0].referenceElement.printTopInPaper=t.paperHeader,o.unshift(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({target:s,printLine:t.height,referenceElement:new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({top:0,left:0,height:0,width:0,beginPrintPaperIndex:t.index,bottomInLastPaper:t.height,printTopInPaper:t.paperHeader})}))),o},BasePrintElement.prototype.updatePanelHeight=function(t,e){var i;"none"==this.panel.panelPageRule&&(i=_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.pt.toMm(t),e.paperFooter=t,e.target.css("height",i+"mm"),e.target.attr("original-height",i))},BasePrintElement.prototype.getBeginPrintTopInPaperByReferenceElement=function(t){var e=this.options.getTop();return this.isHeaderOrFooter()||this.isFixed()?e:t.referenceElement.isPositionLeftOrRight(e)?t.referenceElement.printTopInPaper+(e-t.referenceElement.top):t.referenceElement.bottomInLastPaper+(e-(t.referenceElement.top+t.referenceElement.height))},BasePrintElement.prototype.css=function(i,t){var e,n=this,o=[],r=this.getConfigOptions();r&&(r.tabs&&r.tabs.length?(e=[],r.tabs.forEach(function(t){e=e.concat(t.options)})):e=r.supportOptions,e)&&e.forEach(function(t){var e=_print_element_option_PrintElementOptionItemManager__WEBPACK_IMPORTED_MODULE_2__.a.getItem(t.name);e&&e.css&&(e=e.css(i,n.options.getValueFromOptionsOrDefault(t.name)))&&o.push(e)}),this.stylerCss(i,t)},BasePrintElement.prototype.stylerCss=function(e,t){var i,n=this.getStyler();n&&(i=n(t,this.options,e,this._currenttemplateData))&&Object.keys(i).forEach(function(t){e.css(t,i[t])})},BasePrintElement.prototype.getData=function(i){var t=this.getField();return i?t&&t.split(".").reduce((t,e)=>t?t[e]:i?i[e]:"",!1)||"":this.printElementType.getData()},BasePrintElement.prototype.copyFromType=function(){var e=this.options,i=this.printElementType,t=this.getConfigOptions(),n=[];return t&&t.tabs&&t.tabs.length?t.tabs.forEach(function(t){t.options.forEach(function(t){n.push(t.name)})}):n=t.supportOptions.map(function(t){return t.name}),Object.keys(i).forEach(function(t){i[t]&&"columns"!=t&&-1<n.indexOf(t)&&(e[t]="function"==_typeof(i[t])?i[t].toString():i[t])}),e},BasePrintElement.prototype.getPrintElementOptionTabs=function(){var i,t;return this._printElementOptionTabs||(i=[],(t=this.getConfigOptions())&&(t=t.tabs)&&t.forEach(function(t,e){i.push({name:t.name,list:[]}),t.options.filter(function(t){return!t.hidden}).forEach(function(t){t=_print_element_option_PrintElementOptionItemManager__WEBPACK_IMPORTED_MODULE_2__.a.getItem(t.name);i[e].list.push(t)})}),this._printElementOptionTabs=i,this._printElementOptionItems=void 0),this._printElementOptionTabs},BasePrintElement.prototype.getPrintElementOptionItems=function(){var e,t,i;return this._printElementOptionItems||(e=[],(t=this.getConfigOptions())&&(t.tabs&&t.tabs.length?(i=[],t.tabs.forEach(function(t){t.concat(t.options)})):i=t.supportOptions,i)&&i.filter(function(t){return!t.hidden}).forEach(function(t){t=_print_element_option_PrintElementOptionItemManager__WEBPACK_IMPORTED_MODULE_2__.a.getItem(t.name);e.push(t)}),this._printElementOptionItems=this.filterOptionItems(e.concat()),this._printElementOptionTabs=void 0),this._printElementOptionItems},BasePrintElement.prototype.getPrintElementOptionItemsByName=function(t){var e,i=[],t=this.getConfigOptionsByName(t);return t&&(t.tabs&&t.tabs.length?(e=[],t.tabs.forEach(function(t){e=e.concat(t.options)})):e=t.supportOptions,e)&&e.filter(function(t){return!t.hidden}).forEach(function(t){t=_print_element_option_PrintElementOptionItemManager__WEBPACK_IMPORTED_MODULE_2__.a.getItem(t.name);i.push(t)}),i.concat()},BasePrintElement.prototype.filterOptionItems=function(t){return this.printElementType.field?t.filter(function(t){return"field"!=t.name}):t},BasePrintElement.prototype.createTempContainer=function(){this.removeTempContainer(),jquery__WEBPACK_IMPORTED_MODULE_0___default()("body").append(jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="hiprint_temp_Container hiprint-printPaper" style="overflow:hidden;height: 0px;box-sizing: border-box;"></div>'))},BasePrintElement.prototype.removeTempContainer=function(){jquery__WEBPACK_IMPORTED_MODULE_0___default()(".hiprint_temp_Container").remove()},BasePrintElement.prototype.getTempContainer=function(){return jquery__WEBPACK_IMPORTED_MODULE_0___default()(".hiprint_temp_Container")},BasePrintElement.prototype.isHeaderOrFooter=function(){return this.options.getTopInDesign()<this.panel.paperHeader||this.options.getTopInDesign()>=this.panel.paperFooter},BasePrintElement.prototype.delete=function(){this.designTarget&&this.designTarget.remove()},BasePrintElement.prototype.setCurrenttemplateData=function(t){this._currenttemplateData=t},BasePrintElement.prototype.isFixed=function(){return this.options.fixed},BasePrintElement.prototype.onRendered=function(t,e){this.printElementType&&this.printElementType.onRendered&&this.printElementType.onRendered(e,this.options,t.getTarget())},BasePrintElement.prototype.createLineOfPosition=function(t){var e=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".toplineOfPosition.id"+this.id),i=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".topPosition.id"+this.id),n=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".leftlineOfPosition.id"+this.id),o=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".leftPosition.id"+this.id),r=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".rightlineOfPosition.id"+this.id),a=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".bottomlineOfPosition.id"+this.id),s=_HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__.a.instance;e.length?e.css("top",this.options.displayTop(!0)):((e=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="toplineOfPosition id'+this.id+'" style="position: absolute; width: 100%;"></div>')).css("top",this.options.displayTop(!0)),e.css("width",t.displayWidth()),this.designTarget.parents(".hiprint-printPaper-content").append(e)),s.showPosition&&(i.length?(i.toggleClass("topPosition-lineMode",s.positionLineMode),i.text(this.options.posTop()+(s.positionUnit?"pt":"")),i.css("top",this.options.posTop()-i.height()+"pt"),s.positionLineMode?i.css("left",this.options.posLeft()-i.width()/2+"pt"):i.css("left",this.options.posLeft()+2+"pt"),this.designTarget.find(".size-box")&&this.designTarget.find(".size-box").toggleClass("hide",!0)):((i=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="topPosition id'+this.id+'" style="position: absolute;"></div>')).toggleClass("topPosition-lineMode",s.positionLineMode),i.text(this.options.posTop()+(s.positionUnit?"pt":"")),s.positionLineMode?i.css("left",this.options.posLeft()-i.width()/2+"pt"):i.css("left",this.options.posLeft()+2+"pt"),this.designTarget.find(".size-box")&&this.designTarget.find(".size-box").toggleClass("hide",!0),this.designTarget.parents(".hiprint-printPaper-content").append(i),i.css("top",this.options.posTop()-i.height()+"pt"))),n.length?n.css("left",this.options.displayLeft(!0)):((e=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="leftlineOfPosition id'+this.id+'" style="position: absolute;height: 100%;"></div>')).css("left",this.options.displayLeft(!0)),e.css("height",t.displayHeight()),this.designTarget.parents(".hiprint-printPaper-content").append(e)),s.showPosition&&(o.length?(o.text(this.options.posLeft()+(s.positionUnit?"pt":"")),o.toggleClass("leftPosition-lineMode",s.positionLineMode),o.css("left",this.options.posLeft()-o.width()+"pt"),s.positionLineMode?o.css("top",this.options.posTop()-o.height()/3+"pt"):o.css("top",this.options.posTop()+2+"pt")):((o=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="leftPosition id'+this.id+'" style="position: absolute;"></div>')).text(this.options.posLeft()+(s.positionUnit?"pt":"")),o.toggleClass("leftPosition-lineMode",s.positionLineMode),s.positionLineMode?o.css("top",this.options.posTop()-o.height()/3+"pt"):o.css("top",this.options.posTop()+2+"pt"),this.designTarget.parents(".hiprint-printPaper-content").append(o),o.css("left",this.options.posLeft()-o.width()+"pt"))),r.length?r.css("left",this.options.getLeft()+this.options.getWidth()+"pt"):((i=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="rightlineOfPosition id'+this.id+'" style="position: absolute;height: 100%;"></div>')).css("left",this.options.getLeft()+this.options.getWidth()+"pt"),i.css("height",t.displayHeight()),this.designTarget.parents(".hiprint-printPaper-content").append(i)),a.length?a.css("top",this.options.getTop()+this.options.getHeight()+"pt"):((n=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="bottomlineOfPosition id'+this.id+'" style="position: absolute;width: 100%;"></div>')).css("top",this.options.getTop()+this.options.getHeight()+"pt"),n.css("width",t.displayWidth()),this.designTarget.parents(".hiprint-printPaper-content").append(n))},BasePrintElement.prototype.removeLineOfPosition=function(){jquery__WEBPACK_IMPORTED_MODULE_0___default()(".toplineOfPosition.id"+this.id).remove(),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".topPosition.id"+this.id).remove(),this.designTarget.find(".size-box")&&this.designTarget.find(".size-box").toggleClass("hide",!1),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".leftlineOfPosition.id"+this.id).remove(),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".leftPosition.id"+this.id).remove(),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".rightlineOfPosition.id"+this.id).remove(),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".bottomlineOfPosition.id"+this.id).remove()},BasePrintElement.prototype.getFontList=function(){var t=this.options.fontList;return t||_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.getPrintTemplateById(this.templateId).getFontList()},BasePrintElement.prototype.getFields=function(){return"table"==this.printElementType.type?this.options.tableFields:this.options.fields||_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.getPrintTemplateById(this.templateId).getFields()},BasePrintElement.prototype.getOnImageChooseClick=function(){var t=this.options.onImageChooseClick;return t||_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.getPrintTemplateById(this.templateId).getOnImageChooseClick()},BasePrintElement.prototype.bingCopyEvent=function(t){var e=this;t.keydown(function(t){e._editing&&!t.altKey&&13==t.keyCode?e.updateByContent():(t.ctrlKey||t.metaKey)&&67==t.keyCode&&(e.copyJson(),t.preventDefault())})},BasePrintElement.prototype.copyJson=function(){try{var t=this,e=jquery__WEBPACK_IMPORTED_MODULE_0___default()("#copyArea"),i=(e.length||(e=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<textarea id="copyArea" style="position: absolute; left: 0px; top: 0px;opacity: 0"></textarea>')),jquery__WEBPACK_IMPORTED_MODULE_0___default()("body").append(e),JSON.stringify({options:t.options,printElementType:t.printElementType,id:t.id,templateId:t.templateId})),n=(e.text(i),e.css("visibility","visible"),e.focus(),e.setSelectionRange?e.setSelectionRange(0,e.value.length):e.select(),!1),n=document.execCommand("copy");e.css("visibility","hidden"),t.designTarget.focus()}catch(t){n=!1}return n},BasePrintElement.prototype.clone=function(t){var e=this;let i=e.printElementType.createPrintElement();return Object.keys(e.options).forEach(function(t){i.options[t]=e.options[t]}),i},BasePrintElement.prototype.getFormatter=function(){var formatter=void 0;if(this.printElementType.formatter&&(formatter=this.printElementType.formatter),this.options.formatter)try{var s="formatter="+this.options.formatter;eval(s)}catch(t){}return formatter},BasePrintElement.prototype.getStyler=function(){var fnstyler=void 0;if(this.printElementType.styler&&(fnstyler=this.printElementType.styler),this.options.styler)try{var s="fnstyler="+this.options.styler;eval(s)}catch(t){}return fnstyler},BasePrintElement.prototype.bingKeyboardMoveEvent=function(o,t){var r=this,a=void 0,s=void 0;o.attr("tabindex","1"),o.keydown(function(t){if("INPUT"!=t.target.tagName&&(!r._editing||t.altKey)&&!1!==r.options.draggable){var e=r.panel.printElements.filter(function(t){return"block"==t.designTarget.children().last().css("display")&&!t.printElementType.type.includes("table")}),i=1<e.length,n=_HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__.a.instance.movingDistance;switch(t.keyCode){case 8:case 46:_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.getPrintTemplateById(r.templateId).deletePrintElement(r),_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+r.templateId,"删除"),_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("clearSettingContainer");break;case 37:a=r.options.getLeft(),i?e.forEach(function(t){t.updatePositionByMultipleSelect(0-n,0)}):(r.updateSizeAndPositionOptions(a-n),o.css("left",r.options.displayLeft())),t.preventDefault();break;case 38:s=r.options.getTop(),i?e.forEach(function(t){t.updatePositionByMultipleSelect(0,0-n)}):(r.updateSizeAndPositionOptions(void 0,s-n),o.css("top",r.options.displayTop())),t.preventDefault();break;case 39:a=r.options.getLeft(),i?e.forEach(function(t){t.updatePositionByMultipleSelect(n,0)}):(r.updateSizeAndPositionOptions(a+n),o.css("left",r.options.displayLeft())),t.preventDefault();break;case 40:s=r.options.getTop(),i?e.forEach(function(t){t.updatePositionByMultipleSelect(0,n)}):(r.updateSizeAndPositionOptions(void 0,s+n),o.css("top",r.options.displayTop())),t.preventDefault()}[37,38,39,40].includes(t.keyCode)&&_assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_"+r.templateId,"键盘移动")}})},BasePrintElement.prototype.inRect=function(t){var e=this.designPaper.scale||1,i=this.designTarget[0].offsetLeft,n=this.designTarget[0].offsetTop,o=this.designTarget[0].offsetHeight,r=i+this.designTarget[0].offsetWidth,o=n+o,a=jquery__WEBPACK_IMPORTED_MODULE_0___default()(t.target[0]).position().left/e,e=jquery__WEBPACK_IMPORTED_MODULE_0___default()(t.target[0]).position().top/e,s=t.target[0].offsetHeight,t=t.target[0].offsetWidth;return a<r&&i<a+t&&n<e+s&&e<o},BasePrintElement.prototype.multipleSelect=function(t){t?this.designTarget.addClass("multipleSelect"):this.designTarget.removeClass("multipleSelect")},BasePrintElement.prototype.updatePositionByMultipleSelect=function(t,e){!1!==this.options.draggable&&(this.updateSizeAndPositionOptions(t+this.options.getLeft(),e+this.options.getTop()),this.designTarget.css("left",this.options.displayLeft()),this.designTarget.css("top",this.options.displayTop()))},BasePrintElement}()},function(t,e,i){v.prototype.init=function(t){this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<input type="text" class="hitable-editor-text" value="" />'),t.getTarget().append(this.target),this.target.focus()},v.prototype.getValue=function(){return this.target.val()},v.prototype.setValue=function(t){this.target.val(t)},v.prototype.destroy=function(){this.target.remove()};var n=v,o=(Object.defineProperty(y,"Instance",{get:function(){return y._instance=y._instance?y._instance:new y},enumerable:!0,configurable:!0}),y),r=(b.prototype.init=function(t,i){var n='<select class="auto-submit" style="width:100%">\n <option value="" disabled>请选择字段</option>';t.forEach(function(t,e){t.field==i.field?n+=' <option value="'+(t.field||"")+'" selected >'+(t.text||"")+"</option>":n+=' <option value="'+(t.field||"")+'" >'+(t.text||"")+"</option>"}),n+=" </select>",this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()(n),i.getTarget().append(this.target),this.target.focus()},b.prototype.getValue=function(){var t=this.target.val();return this.target.find('option[value="'+t+'"]').text()+"#"+t},b.prototype.setValue=function(t){t&&!this.target.find('option[value="'+t+'"]').length&&this.target.find("select").prepend('<option value="'+t+'" >'+t+"</option>"),this.target.find("select").val(t)},b.prototype.destroy=function(){this.target.remove()},b),a=(Object.defineProperty(I,"Instance",{get:function(){return I._instance=I._instance?I._instance:new I},enumerable:!0,configurable:!0}),I),s=(Object.defineProperty(f,"Instance",{get:function(){return f._instance=o._instance?f._instance:new f},enumerable:!0,configurable:!0}),f.prototype.createEditor=function(t){return jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({},o.Instance[t])},f.prototype.createSelect=function(t){return jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({},a.Instance[t])},f),p=i(10),l=i(14),d=i(11),u=(m.prototype.init=function(t,e){var i=this;this.tableOptions=e,this.title=t.title,this.field=t.field,t.getTarget().unbind("dblclick.hitable").bind("dblclick.hitable",function(){t.isEditing=!0,i.beginEdit(t)})},m.prototype.getDisplayHtml=function(){return this.title},m.prototype.beginEdit=function(e){var i=this;i.tableOptions.options.fields&&i.tableOptions.options.fields.length?(this.editor=s.Instance.createSelect("select"),e.getTarget().html(""),this.editor.init(i.tableOptions.options.fields,e),this.editor.setValue(this.field||""),jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.editor.target).keydown(function(t){13==t.keyCode&&i.endEdit(e)}),jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.editor.target).change(function(t){i.endEdit(e)}),jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.editor.target).blur(function(t){i.endEdit(e)})):(this.editor=s.Instance.createEditor("text"),e.getTarget().html(""),this.editor.init(e),(this.title||this.field)&&(this.tableOptions.options.isEnableEditField?this.editor.setValue((this.title||"")+"#"+(this.field||"")):this.editor.setValue(this.title||"")),jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.editor.target).keydown(function(t){13==t.keyCode&&i.endEdit(e)}),jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.editor.target).blur(function(t){i.endEdit(e)}),this.tableOptions.editingCell&&this.tableOptions.editingCell.id!=e.id&&this.tableOptions.editingCell.innerElement.endEdit(this.tableOptions.editingCell),this.tableOptions.editingCell=e)},m.prototype.endEdit=function(t){t.isEditing=0;var e,i=this.editor.getValue();i?this.tableOptions.options.isEnableEditField||this.tableOptions.options.fields?(e=i.split("#"),t.title=this.title=e[0],0<e.length&&(t.columnId=t.field=this.field=e[1]),t.id&&t.target.attr("id",t.id),t.columnId&&t.target.attr("column-id",t.columnId),hinnn.event.trigger("hiprintTemplateDataChanged_"+this.tableOptions.options.templateId,"调整表格列字段")):t.title=this.title=i:this.tableOptions.options.isEnableEditField?(t.title=this.title="",t.field=this.field=""):t.title=this.title="",this.editor.destroy(),t.getTarget().html(this.title)},m),c=function(t){this.title=t.title,this.field=t.field,this.width=t.width,this.align=t.align,this.halign=t.halign,this.vAlign=t.vAlign,this.colspan=t.colspan,this.rowspan=t.rowspan,this.checked=t.checked,this.columnId=t.columnId,this.tableSummaryTitle=t.tableSummaryTitle,this.tableSummaryText=t.tableSummaryText,this.tableSummaryColspan=t.tableSummaryColspan,this.tableSummary=t.tableSummary,this.tableSummaryAlign=t.tableSummaryAlign,this.tableSummaryNumFormat=t.tableSummaryNumFormat,this.upperCase=t.upperCase,this.renderFormatter=t.renderFormatter&&t.renderFormatter.toString(),this.formatter2=t.formatter2&&t.formatter2.toString(),this.styler2=t.styler2&&t.styler2.toString(),this.stylerHeader=t.stylerHeader&&t.stylerHeader.toString(),this.tableColumnHeight=t.tableColumnHeight,this.tableTextType=t.tableTextType,this.tableBarcodeMode=t.tableBarcodeMode,this.tableQRCodeLevel=t.tableQRCodeLevel},h=(g.prototype.init=function(t,e,i,n){this.isHead=n,this.rowId=i,this.isEditing=!1;n=/^[0-9]*$/,this.target=t,this.tableOptions=e,i=this.target.attr("colspan"),this.colspan=n.test(i)?parseInt(i):1,t=this.target.attr("rowspan");this.rowspan=n.test(t)?parseInt(t):1,this.initEvent(),this.isHead&&this.initInnerEelement()},g.prototype.beginEdit=function(){var t;!this.isEditing&&this.tableOptions.isEnableEdit&&this.tableOptions.onBeforEdit(this)&&(t=this.getValue(),this.editor=s.Instance.createEditor("text"),this.isEditing=!0,(this.tableOptions.editingCell=this).target.html(""),this.editor.init(this),this.editor.setValue(t))},g.prototype.endEdit=function(){this.isEditing=!1;var t=this.editor.getValue();this.editor.destroy(),this.target.html(t)},g.prototype.getTarget=function(){return this.target},g.prototype.getValue=function(){return this.target.html()},g.prototype.setValue=function(t){},g.prototype.initInnerEelement=function(){this.innerElement=new u,this.innerElement.init(this,this.tableOptions)},g.prototype.initEvent=function(){},g.prototype.isXYinCell=function(t,e){t=new p.b({x:t,y:e,height:0,width:0});return this.isOverlap(t)},g.prototype.getTableRect=function(){return new p.b({x:this.target.offset().left,y:this.target.offset().top,height:this.target[0].offsetHeight,width:this.target[0].offsetWidth})},g.prototype.isOverlap=function(t){var e=this.getTableRect();return t.x+t.width>e.x&&e.x+e.width>t.x&&t.y+t.height>e.y&&e.y+e.height>t.y},g.prototype.isInRect=function(t){var e=t.rect,i=this.getTableRect();return i.x>=e.x&&i.x+i.width<=e.x+e.width&&i.y>=e.y&&i.y+i.height<=e.y+e.height&&(i=l.a.mergeRect(e,i),JSON.stringify(e)==JSON.stringify(i)||(t.changed=!0,t.rect=i,!0))},g.prototype.isSelected=function(){return this.target.hasClass("selected")},g.prototype.select=function(){this.target.addClass("selected")},g.prototype.isHeader=function(){return!1},g.prototype.setAlign=function(t){(this.align=t)?this.target.css("text-align",t):this.target[0].style.textAlign=""},g.prototype.setVAlign=function(t){(this.vAlign=t)?this.target.css("vertical-align",t):this.target[0].style.verticalAlign=""},g.prototype.getEntity=function(){return new c(this)},g);function g(){this.id=d.a.createId()}function m(){}function f(){}function I(){this.select=new r}function b(){}function y(){this.text=new n}function v(){}i.d(e,"a",function(){return _});(function(t,e){(Object.setPrototypeOf||(_instanceof({__proto__:[]},Array)?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)})(P=E,i=M=h),P.prototype=null===i?Object.create(i):(T.prototype=i.prototype,new T),E.prototype.css=function(t){};var M,P,_=E;function E(t){var e=this;return t=t||{},(e=M.call(this)||this).width=t.width?par