Files
smart-table/dist/smartTable.min.js
2020-01-31 17:12:19 +08:00

1 line
18 KiB
JavaScript

!function(t){var e={};function r(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(i,a,function(e){return t[e]}.bind(null,a));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){var i=r(1),a=r(2);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[t.i,a,""]]);var o={insert:"head",singleton:!1},l=(i(t.i,a,o),a.locals?a.locals:{});t.exports=l},function(t,e,r){"use strict";var i,a=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var t={};return function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}t[e]=r}return t[e]}}(),l={};function n(t,e,r){for(var i=0;i<e.length;i++){var a={css:e[i][1],media:e[i][2],sourceMap:e[i][3]};l[t][i]?l[t][i](a):l[t].push(p(a,r))}}function s(t){var e=document.createElement("style"),i=t.attributes||{};if(void 0===i.nonce){var a=r.nc;a&&(i.nonce=a)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var l=o(t.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(e)}return e}var d,f=(d=[],function(t,e){return d[t]=e,d.filter(Boolean).join("\n")});function c(t,e,r,i){var a=r?"":i.css;if(t.styleSheet)t.styleSheet.cssText=f(e,a);else{var o=document.createTextNode(a),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(o,l[e]):t.appendChild(o)}}function h(t,e,r){var i=r.css,a=r.media,o=r.sourceMap;if(a?t.setAttribute("media",a):t.removeAttribute("media"),o&&btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var b=null,u=0;function p(t,e){var r,i,a;if(e.singleton){var o=u++;r=b||(b=s(e)),i=c.bind(null,r,o,!1),a=c.bind(null,r,o,!0)}else r=s(e),i=h.bind(null,r,e),a=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(r)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else a()}}t.exports=function(t,e,r){return(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=a()),t=r.base?t+r.base:t,e=e||[],l[t]||(l[t]=[]),n(t,e,r),function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){l[t]||(l[t]=[]),n(t,e,r);for(var i=e.length;i<l[t].length;i++)l[t][i]();l[t].length=e.length,0===l[t].length&&delete l[t]}}}},function(t,e,r){(e=r(3)(!1)).push([t.i,'.smart-table{position:relative;overflow:hidden;box-sizing:border-box;width:100%;max-width:100%;background-color:#fff;color:#606266;border:1px solid #EBEEF5;border-right:none;border-bottom:none}.smart-table:after,.smart-table:before{content:"";position:absolute;background-color:#ebeef5;z-index:1}.smart-table:before{left:0;bottom:0;width:100%;height:1px}.smart-table:after{top:0;right:0;width:1px;height:100%}.smart-table table{border-spacing:0;border:0}.smart-table tr{transition:background-color .25s ease}.smart-table thead{color:#909399;font-weight:500;background:#F5F7FA}.smart-table thead tr{background:#F5F7FA}.smart-table tbody.stripe tr:nth-child(2n){background-color:#F5F7FA}.smart-table th{user-select:none;overflow:hidden}.smart-table th[sort]{cursor:pointer}.smart-table th[sort] :after{margin-left:5px;content:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAAAXNSR0IArs4c6QAAAR5JREFUKBVjYKA7+P//P/OBo2dmHzx6rgab5YzIgseOPeb8/e/Vyv8M/33B4owM0+2tjHMYGRn/wdTBNRw7dlXo9/8fm4E2WMEkQTQjA+N6OWmhKEVFxR8QPpA8eOqyLMPvXzuBijVBgugAaMNhPi4mP0NDww8sIMn/f35aMP1nnA00DV0thP+fgeHz93/mQM5O7ArwiIKNPHDkjCMTEwM/HnUM//4zvXSwNjoOdhIzK9O7f7//LQXaLIlNE9DUW+zMjO4gObijjx8/r/Dr79+dQE1qyJoYGRlOcbMzeJuYmLwBiTPBJC0tDR9wczBYgxTAxIDsbUDFjjDFIHG4DTBFFy9e5P7w+c/q/4wML+2tjFKBQfoHJoeTBiUPXJIAbjheeFXAZxsAAAAASUVORK5CYII=")}.smart-table th[sort].desc :after{content:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAAAXNSR0IArs4c6QAAASdJREFUKBVjYKA7+P//P/OBo2dmHzx6rgab5YzIgseOPeb8/e/Vyv8M/33B4owM0+2tjHMYGRn/wdTBNRw7dlXo9/8fm4E2WMEkQTQjA+N6OWmhKEVFxR8QPpA8eOqyLMPvXzuBijVBgugAaMNhPi4mP0NDww8sIMn/f35aMP1nnA00DV0thP+fgeHz93/mQM5O7ArwiIKNdF7435HhHwM/HnUMDEwML/fGMx4HO+kfE8O7//8YljL8Z5DEpomRkeEW+z8Gd5AcE4jYH8t4kYOBwQokAeIjA6DYKR52BusdiYwPQOIovvRd9l/ky0+Grf//M5iBJRkZtvGIMIRu9mX8BuKDAIoGkIDbov/cv/4wrAbKvHRQYEhtcGT8AxLHC0JX/WfGpQAAJIlcYMXwsAoAAAAASUVORK5CYII=")}.smart-table th[sort].asc :after{content:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAAAXNSR0IArs4c6QAAARlJREFUKBVjYKA7aPj/n8lx/v+pQFyFzXJGZEHPbf/Zf7xkWPr/P0MwSJyRkWGqfQJDXgMj4z+YOrgGl1X/+f9+Ydj4n4HBHiYJ1bSWQ5whersX408wH0S4Lv8v9ecHw3agyXogPjoAmnqQmYfBf08Y40cWkOSfnww2DIwMS4FOWIquGMb/+5XBGsjeBuMTTYP9cODIGUcmJgZ+fLr+/Wd66WBtdBzsJGZWpnf/fv9bCvSwJDZNQFNvsTMzuoPk4KF0/Ph5hV9//+4EalJD1gT01yludgZvExOTNyBxJpikpaXhA24OBmuQApgYkL0NqNgRphgkDrcBpujixYvcHz7/Wf2fkeGlvZVRKiMj4x+YHE76////zLgkATPDVMggLp6aAAAAAElFTkSuQmCC")}.smart-table td,.smart-table th{padding:6px 0;min-width:50px;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;border-bottom:1px solid #EBEEF5;border-right:1px solid #EBEEF5;text-align:center}.smart-table td.is-hidden>*,.smart-table th.is-hidden>*{visibility:hidden}.smart-table.smart-table-custom-large td,.smart-table.smart-table-custom-large th{padding:12px 0}.smart-table.smart-table-custom-middle td,.smart-table.smart-table-custom-middle th{padding:10px 0}.smart-table.smart-table-custom-left td,.smart-table.smart-table-custom-left th{text-align:left}.smart-table.smart-table-custom-right td,.smart-table.smart-table-custom-right th{text-align:right}.smart-table .smart-table_cell{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding-left:4px;padding-right:4px}.smart-table th>.smart-table_cell{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;vertical-align:middle;padding-left:4px;padding-right:4px;width:100%}.smart-table .smart-table_body,.smart-table .smart-table_footer,.smart-table .smart-table_header{table-layout:fixed;border-collapse:separate;background:#fff}.smart-table .smart-table_header-wrapper{overflow:hidden}.smart-table .smart-table_body-wrapper{overflow:auto}.smart-table .smart-table_fixed,.smart-table .smart-table_fixed-right{position:absolute;top:0;left:0;overflow-x:hidden;overflow-y:hidden;box-shadow:0 -1px 8px rgba(0,0,0,0.08)}.smart-table .smart-table_fixed-right{top:0;left:auto;right:0;box-shadow:-1px 0 8px rgba(0,0,0,0.08)}.smart-table .smart-table_fixed-right .smart-table_fixed-body-wrapper,.smart-table .smart-table_fixed-right .smart-table_fixed-footer-wrapper,.smart-table .smart-table_fixed-right .smart-table_fixed-header-wrapper{left:auto;right:0}.smart-table .smart-table_fixed-right-patch{position:absolute;top:-1px;right:0;background-color:#F5F7FA}.smart-table .smart-table_fixed-header-wrapper{position:absolute;left:0;top:0;z-index:3}.smart-table .smart-table_fixed-body-wrapper{position:absolute;left:0;top:37px;overflow:hidden;z-index:3}.smart-table .smart-table_hover-tr{background-color:#f0f5fd !important}.smart-table ::-webkit-scrollbar{width:8px;height:8px;background-color:#e9edf4}.smart-table ::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:2em;-webkit-border-radius:2em;-moz-border-radius:2em;-o-border-radius:2em}.smart-table ::-webkit-scrollbar-thumb:hover{background-color:#9bbbfa}\n',""]),t.exports=e},function(t,e,r){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=function(t,e){var r=t[1]||"",i=t[3];if(!i)return r;if(e&&"function"==typeof btoa){var a=(l=i,n=btoa(unescape(encodeURIComponent(JSON.stringify(l)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(s," */")),o=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")}));return[r].concat(o).concat([a]).join("\n")}var l,n,s;return[r].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(r,"}"):r})).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var i=0;i<t.length;i++){var a=[].concat(t[i]);r&&(a[2]?a[2]="".concat(r," and ").concat(a[2]):a[2]=r),e.push(a)}},e}},function(t,e,r){"use strict";r.r(e);r(0);function i(t,e,r,i){if(!t.data||t.data.length<1)return;let o=function t(e,r,i,o){if(e.length<=1)return e;let l=[],n=[],s=e.length,d=Math.floor(s/2),f=e.splice(d,1)[0];for(let t=0;t<s-1;t++)a(e[t][r],f[r],i,o)?l.push(e[t]):n.push(e[t]);return t(l,r,i,o).concat(f,t(n,r,i,o))}(JSON.parse(JSON.stringify(t.data)),e,r,i);JSON.stringify(t.data)!==JSON.stringify(o)&&(!function(t,e){let r=0;for(let i=0;i<e.length;i++){const a=e[i];let o=0;for(;o<t.length;o++){const l=t[o];if(a.$key===l.$key){if(a.$el=l.$el,a.$fixedLeftEl=l.$fixedLeftEl,a.$fixedRightEl=l.$fixedRightEl,o<r){const t=e[i-1],r=t.$el.nextSibling;if(r.parentNode.insertBefore(l.$el,r),t.$fixedLeftEl){const e=t.$fixedLeftEl.nextSibling;e.parentNode.insertBefore(l.$fixedLeftEl,e)}if(t.$fixedRightEl){const e=t.$fixedRightEl.nextSibling;e.parentNode.insertBefore(l.$fixedRightEl,e)}}else r=o;break}}}}(t.data,o),t.data=o)}function a(t,e,r,i){return"number"===i&&(t=parseFloat(t),e=parseFloat(e)),"ASC"===r?t<e:t>e}function o(t,e){let r=document.createElement(t);return e&&(r.className=e),r}function l(t,e){return t.appendChild(e)}function n(t,e){return e.forEach(e=>{t.appendChild(e)}),t}function s(t,e){t.removeChild(e)}function d(t,e){return t.cloneNode(e)}function f(t,e){return t.querySelector(e)}function c(t,e){return t.querySelectorAll(e)}function h(t){let e=t.childNodes,r=o("div","smart-table_cell");for(;e.length;)l(r,e[0]);l(t,r)}function b(t,e,r,i){let a=o("div",t),s=o("table","smart-table_"+r);return s.style.width=e.size.tabelWidth-1+"px",n(s,[g(e.colgroup),i]),l(a,s),a}function u(t,e){let r=g(t.colgroup);e.replaceChild(r,f(e,"colgroup"))}function p(t,e,r){return Number.parseInt(t.getAttribute(e)||r)}function g(t){if(!t)return;let e=o("colgroup");return t.forEach(t=>{let r=o("col");r.setAttribute("width",t),l(e,r)}),e}let m;function x(t,e,r){if(e){let i=f(e,".smart-table_header"),a=f(e,".smart-table_body");u(t,i),u(t,a);const o=c(f(e,"tr"),"th");let l=0;o.forEach((e,r)=>{"is-hidden"!=e.className&&(l+=t.colgroup[r])}),e.style.width=l+"px",i.style.width=r+"px",a.style.width=r+"px"}}function A(t){this instanceof A||console.error("Smart Table is a constructor and should be called with the `new` keyword"),window.addEventListener("load",()=>{setTimeout(this._init(t),0)})}A.prototype._init=function(t={}){t.selector||console.error("Smart Table init need a selector");const e=this;e.$options=t;const r=t.selector&&f(document,String(t.selector).trim());if(!r)return;const a=f(r,"table");if(!a)return;e.gutterWidth=function(){if(void 0!==m)return m;const t=o("div","smart-table");l(document.body,t);const e=o("div");e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",l(t,e);const r=e.offsetWidth;e.style.overflow="scroll";const i=o("div");i.style.width="100%",l(e,i);const a=i.offsetWidth;return s(t.parentNode,t),m=r-a,m}(),r.classList.add("smart-table"),t.size&&r.classList.add("smart-table-custom-"+t.size),t.align&&r.classList.add("smart-table-custom-"+t.align);const g=f(a,"thead"),A=f(a,"tbody");c(g,"th").forEach(t=>h(t)),c(A,"td").forEach(t=>h(t)),a.hasAttribute("stripe")&&A.classList.add("stripe"),a.style.width="100%",e.$root=r;const w=g.offsetHeight,y=a.offsetHeight;let v=t.height;if(v=("function"==typeof v?v():v)||y,v=v>w?v:w+100,e.size={theadHeight:w,tbodyHeight:v-w,tabelWidth:a.offsetWidth,wrapperWidth:a.offsetWidth,tableHeight:v,fixWrapperHeigth:y>v?v:y},e.props=function(t){let e={},r=[],i=c(t,"tr");return i.forEach((t,e)=>{let i=r[e]||[];c(t,"th").forEach(t=>{let a=p(t,"rowspan",1),o=p(t,"colspan",1),l=function(t){for(let e=0,r=t.length;e<r;e++)if(void 0===t[e])return e}(i)||i.length;if(i[l]=t,t.hasAttribute("sort")&&t.setAttribute("sortkey","field-"+l),o>1)for(let t=1;t<o;t++)i[l+t]=0;if(a>1)for(let t=1;t<a;t++){let i=r[e+t]||[];for(let t=0;t<o;t++)i[l+t]=0;r[e+t]=i}r[e]=i})}),e.theadLength=i.length,e.shapes=r,e}(g),e.colgroup=function(t,e,r){let i=[];return 1===r?c(f(t,"tr"),"th").forEach(t=>{let e=p(t,"width",0);0===e&&(e=t.offsetWidth>80?t.offsetWidth:80),i.push(e)}):c(f(e,"tr"),"td").forEach(t=>{let e=t.offsetWidth;e+=e<50?10:e>=50&&e<100?30:40,i.push(e)}),i}(g,A,e.props.theadLength),e.size.tabelWidth=a.style.width=e.colgroup.reduce((t,e)=>t+e),e.scrollY=v<a.offsetHeight,e.scrollX=r.offsetWidth<e.size.tabelWidth,function(t,e){let{colgroup:r,props:i}=e;const a=r.length;let o={thead:[],tbody:[],width:0},l={thead:[],tbody:[],width:0};const n=c(f(t,"tr"),"th"),s=n.length;let d=0;if(0!==s){if(n[0].hasAttribute("fixed"))for(let t=0;t<s-1;t++)if(n[t].hasAttribute("fixed")){d=t,o.thead.push("field-"+t);let e=p(n[t],"colspan",1);for(let i=0;i<e;i++)o.tbody.push("field-"+(t+i)),o.width=o.width+r[t+i]}if(n[s-1].hasAttribute("fixed")){let t=0;for(let e=s-1;e>0;e--)if(n[e].hasAttribute("fixed")){if(e===d)break;l.thead.push("field-"+e);let i=p(n[e],"colspan",1);for(let e=0;e<i;e++)t++,l.tbody.push("field-"+(a-t)),l.width=l.width+r[a-t]}}}i.fixedLeft=o,i.fixedRight=l}(g,e),e.$theadWrapper=b("smart-table_header-wrapper",e,"header",g),e.$tbodyWrapper=b("smart-table_body-wrapper",e,"body",A),n(r,[e.$theadWrapper,e.$tbodyWrapper]),e.size.theadHeight=g.offsetHeight,e.size.tbodyHeight=v-g.offsetHeight,s(a.parentNode,a),function(t,e,r){const{fixedLeft:i,fixedRight:a}=t.props;let s=320;if(c(t.$root,".smart-table_body-wrapper").forEach(e=>{e.style.height=t.size.tbodyHeight+"px"}),i.thead.length>0){s=s>i.width?s:i.width;let a=d(e,!0);c(f(a,"tr"),"th").forEach((t,e)=>{-1===i.thead.indexOf("field-"+e)&&t.classList.add("is-hidden")});let h=b("smart-table_fixed-header-wrapper",t,"header",a),u=d(r,!0);c(u,"tr").forEach(t=>{c(t,"td").forEach((t,e)=>{-1===i.tbody.indexOf("field-"+e)&&t.classList.add("is-hidden")})});let p=b("smart-table_fixed-body-wrapper",t,"body",u);p.style.top=t.size.theadHeight+"px",p.style.height=t.size.tbodyHeight-(t.scrollX?t.gutterWidth:0)+"px";let g=o("div","smart-table_fixed");n(g,[h,p]),g.style.width=i.width+"px",g.style.height=t.size.fixWrapperHeigth-(t.scrollX?t.gutterWidth:0)+"px",l(t.$root,g),t.$fixedLeft=p}if(a.thead.length>0){s+=a.width;let i=d(e,!0);c(f(i,"tr"),"th").forEach((t,e)=>{-1===a.thead.indexOf("field-"+e)&&t.classList.add("is-hidden")});let h=b("smart-table_fixed-header-wrapper",t,"header",i),u=d(r,!0);c(u,"tr").forEach(t=>{c(t,"td").forEach((t,e)=>{-1===a.tbody.indexOf("field-"+e)&&t.classList.add("is-hidden")})});let p=b("smart-table_fixed-body-wrapper",t,"body",u);p.style.top=t.size.theadHeight+"px",p.style.height=t.size.tbodyHeight-(t.scrollX?t.gutterWidth:0)+"px";let g=o("div","smart-table_fixed-right");if(g.style.right=(t.scrollY?t.gutterWidth:0)+"px",n(g,[h,p]),g.style.width=a.width+"px",g.style.height=t.size.fixWrapperHeigth-(t.scrollX?t.gutterWidth:0)+"px",l(t.$root,g),t.$fixedRight=p,t.scrollY){let e=o("div","smart-table_fixed-right-patch");e.style.width=t.gutterWidth+"px",e.style.height=t.size.theadHeight+"px",l(t.$root,e)}}t.$root.style.minWidth=s+"px"}(e,g,A),e.data=function(t,e){let r=t.$fixedLeft&&c(t.$fixedLeft,"tbody tr"),i=t.$fixedRight&&c(t.$fixedRight,"tbody tr"),a=[];return c(e,"tr").forEach((t,e)=>{if(!t.hasAttribute("unsort")){let o={$el:t,$fixedLeftEl:r&&r[e],$fixedRightEl:i&&i[e],$key:"$$rowkey"+e};c(t,"td .cell").forEach((t,e)=>{o["field-"+e]=t.innerHTML}),a.push(o)}}),a}(e,A),function(t){let e=Array.from(c(t.$root,"th[sort]"));0!==e.length&&e.forEach(r=>{r.addEventListener("click",a=>{a.stopPropagation();let o="ASC",l=r.getAttribute("sort")||"string";r.classList.contains("asc")?(r.classList.remove("asc"),r.classList.add("desc"),o="DESC"):(r.classList.remove("desc"),r.classList.add("asc")),e=e.map(t=>(r!=t&&t.classList.remove("asc","desc"),t)),i(t,r.getAttribute("sortkey"),o,l)})})}(e),function(t){t.$tbodyWrapper.addEventListener("scroll",()=>function(t){!function(t,e){let r,i=0;return function(){let a=this,o=(new Date).getTime()-i,l=arguments;function n(){i=(new Date).getTime(),e.apply(a,l)}r&&clearTimeout(r),o>t?n():r=setTimeout(n,t-o)}}(20,()=>{t.$theadWrapper.scrollLeft=t.$tbodyWrapper.scrollLeft,t.$fixedLeft&&(t.$fixedLeft.scrollTop=t.$tbodyWrapper.scrollTop),t.$fixedRight&&(t.$fixedRight.scrollTop=t.$tbodyWrapper.scrollTop)})()}(t),{passive:!0}),window.addEventListener("resize",function(t,e){let r=null;return function(){null!==r&&clearTimeout(r),r=setTimeout(e,t)}}(600,()=>{let e=t.$root,r=t.size.wrapperWidth,i=t.size.tabelWidth,a=e.offsetWidth,o=parseInt(i*(a/r)),l=f(t.$theadWrapper,".smart-table_header"),n=f(t.$tbodyWrapper,".smart-table_body");t.colgroup.forEach((function(e,r){t.colgroup[r]=parseInt(o*(e/i))+1})),t.size.wrapperWidth=a,t.size.tabelWidth=o,l.style.width=o+"px",n.style.width=o+"px",u(t,l),u(t,n),x(t,f(e,".smart-table_fixed"),o),x(t,f(e,".smart-table_fixed-right"),o)}));let e=c(t.$tbodyWrapper,"tr"),r=c(t.$root,".smart-table_fixed .smart-table_fixed-body-wrapper tr"),i=c(t.$root,".smart-table_fixed-right .smart-table_fixed-body-wrapper tr");e.forEach((t,e)=>{t.addEventListener("mouseenter",()=>{t.className="smart-table_hover-tr",r.length>0&&(r[e].className="smart-table_hover-tr"),i.length>0&&(i[e].className="smart-table_hover-tr")}),t.addEventListener("mouseleave",()=>{t.className="",r.length>0&&(r[e].className=""),i.length>0&&(i[e].className="")})})}(e),e.scrollY){let t=o("th");t.setAttribute("width",e.gutterWidth),t.setAttribute("rowspan",e.props.shapes.length),l(f(g,"tr"),t)}};var w=A;window.SmartTable=w}]);