UNPKG

canvas-datagrid

Version:

Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.

1 lines 248 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.canvasDatagrid=t():e.canvasDatagrid=t()}(self,(function(){return function(){var __webpack_modules__={392:function(e,t,r){"use strict";function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function l(e){var t;function r(){if(e.buttonMenu)e.disposeButtonMenu();else{var r={left:e.button.wrapper.left-e.scrollBox.scrollLeft,top:e.button.wrapper.top+e.button.wrapper.offsetHeight-e.scrollBox.scrollTop};e.buttonMenu=function(r,l){var i,a,s,c=document.createElement("div"),d=-1,u={};function f(){function t(t,r){var o;null!==(o=t.title)&&("object"!==n(o)?(function(t){e.createInlineStyle(t,"canvas-datagrid-button-menu-item"+(e.mobile?"-mobile":"")),t.addEventListener("mouseover",(function(){e.createInlineStyle(t,"canvas-datagrid-button-menu-item:hover")})),t.addEventListener("mouseout",(function(){e.createInlineStyle(t,"canvas-datagrid-button-menu-item")}))}(r),r.innerHTML=o):r.appendChild(o)),t.buttonMenuItemContainer=r,t.click&&r.addEventListener("click",(function(r){t.click.apply(e,[r]),e.disposeButton()}))}var r,i=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,l=function(){};return{s:l,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(l);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=document.createElement("div");t(a,s),c.appendChild(s)}}catch(e){i.e(e)}finally{i.f()}}return u.buttonMenu=c,a={},s=e.scrollOffset(e.canvas),void 0===t&&(t=e.style.buttonZIndex),f(),e.createInlineStyle(c,"canvas-datagrid-button-menu"+(e.mobile?"-mobile":"")),a.x=r.left-s.left,a.y=r.top-s.top,a.height=0,t+=1,c.style.position="absolute",c.style.zIndex=t,c.style.left=a.x+"px",c.style.top=a.y+"px",document.body.appendChild(c),(i=c.getBoundingClientRect()).bottom>window.innerHeight&&(a.y=e.button.wrapper.top-c.offsetHeight-e.scrollBox.scrollTop,a.y<0&&(a.y=e.style.buttonMenuWindowMargin),c.offsetHeight>window.innerHeight-e.style.buttonMenuWindowMargin&&(c.style.height=window.innerHeight-2*e.style.buttonMenuWindowMargin+"px")),i.right>window.innerWidth&&(a.x-=i.right-window.innerWidth+e.style.buttonMenuWindowMargin),a.x<0&&(a.x=e.style.buttonMenuWindowMargin),a.y<0&&(a.y=e.style.buttonMenuWindowMargin),c.style.left=a.x+"px",c.style.top=a.y+"px",u.clickIndex=function(e){l[e].buttonMenuItemContainer.dispatchEvent(new Event("click"))},u.rect=i,u.items=l,u.dispose=function(){c.parentNode&&c.parentNode.removeChild(c)},Object.defineProperty(u,"selectedIndex",{get:function(){return d},set:function(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Button menu selected index must be a sane number.");(d=t)>l.length-1&&(d=l.length-1),d<0&&(d=0),l.forEach((function(t,r){if(r===d)return e.createInlineStyle(t.buttonMenuItemContainer,"canvas-datagrid-button-menu-item:hover");e.createInlineStyle(t.buttonMenuItemContainer,"canvas-datagrid-button-menu-item")}))}}),u}(r,e.button.items),e.createInlineStyle(e.button.wrapper,"canvas-datagrid-button-wrapper:active"),requestAnimationFrame((function(){document.addEventListener("click",e.disposeButtonMenu)}))}}e.disposeButtonMenu=function(){e.buttonMenu&&(document.removeEventListener("click",e.disposeButtonMenu),e.buttonMenu.dispose(),e.buttonMenu=void 0,e.createInlineStyle(e.button.wrapper,"canvas-datagrid-button-wrapper:hover"))},e.disposeButton=function(r){r&&27!==r.keyCode||(document.removeEventListener("keydown",e.disposeButton),t=e.style.buttonZIndex,e.disposeButtonMenu(),e.button&&e.button.dispose(),e.button=void 0)},e.moveButtonPos=function(){e.button.wrapper.style.left=e.button.wrapper.left-e.scrollBox.scrollLeft+"px",e.button.wrapper.style.top=e.button.wrapper.top-e.scrollBox.scrollTop+"px",e.disposeButtonMenu()},e.attachButton=function(o,n,l){e.button&&e.disposeButton(),e.button=function(o,n,l){var i=document.createElement("div"),a=document.createElement("div"),s=document.createElement("div"),c={};if(!Array.isArray(n))throw new Error("createButton expects an array.");return c.wrapper=i,c.items=n,function(){var n,c={},d=e.scrollOffset(e.canvas);if(void 0===t&&(t=e.style.buttonZIndex),n=i,e.createInlineStyle(n,"canvas-datagrid-button-wrapper"),n.addEventListener("mouseover",(function(){e.buttonMenu||e.createInlineStyle(n,"canvas-datagrid-button-wrapper:hover")})),n.addEventListener("mouseout",(function(){e.buttonMenu||e.createInlineStyle(n,"canvas-datagrid-button-wrapper")})),e.createInlineStyle(s,"canvas-datagrid-button-icon"),e.createInlineStyle(a,"canvas-datagrid-button-arrow"),c.x=o.left-d.left,c.y=o.top-d.top,c.height=0,t+=1,i.style.position="absolute",i.style.zIndex=t,i.style.left=c.x+"px",i.style.top=c.y+"px",i.left=o.left+e.scrollBox.scrollLeft,i.top=o.top+e.scrollBox.scrollTop,a.innerHTML=e.style.buttonArrowDownHTML,l){var u=document.createElement("img");u.setAttribute("src",l),u.style.maxWidth="100%",u.style.height="100%",s.appendChild(u)}i.appendChild(s),i.appendChild(a),document.body.appendChild(i),i.addEventListener("click",r)}(),c.dispose=function(){i.parentNode&&i.parentNode.removeChild(i)},c}(o,n,l),requestAnimationFrame((function(){document.addEventListener("keydown",e.disposeButton)}))}}r.d(t,{Z:function(){return l}})},195:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var o=r(857);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function l(){var e,t={dehyphenateProperty:function(e){e=e.replace("--cdg-","");var t,r="";return Array.prototype.forEach.call(e,(function(e){if(t)return t=!1,void(r+=e.toUpperCase());"-"!==e?r+=e:t=!0})),r},hyphenateProperty:function(e,t){var r="";return Array.prototype.forEach.call(e,(function(e){e!==e.toUpperCase()?r+=e:r+="-"+e.toLowerCase()})),(t?"--cdg-":"")+r},applyComponentStyle:function(r,l){if(l.isComponent){var i=window.getComputedStyle("CANVAS-DATAGRID"===l.tagName?l:l.canvas,null),a={};l.computedStyle=i,(0,o.Z)(a),a.defaults.styles.forEach((function(r){var o;""===(o=i.getPropertyValue(t.hyphenateProperty(r[0],!0)))&&(o=i.getPropertyValue(t.hyphenateProperty(r[0],!1))),""!==o&&"string"==typeof o&&l.setStyleProperty(r[0],e[n(r[1])](o.replace(/^\s+/,"").replace(/\s+$/,""),r[1]),!0)})),!r&&l.dispatchEvent&&(requestAnimationFrame((function(){l.resize(!0)})),l.dispatchEvent("stylechanged",l.style))}}};return e={data:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Cannot read JSON data in canvas-datagrid data.")}},schema:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Cannot read JSON data in canvas-datagrid schema attribute.")}},number:function(e,t){var r=parseInt(e,10);return isNaN(r)?t:r},boolean:function(e){return/true/i.test(e)},string:function(e){return e}},t.getObservableAttributes=function(){var e={},t=["data","schema","style","className","name"];return(0,o.Z)(e),e.defaults.attributes.forEach((function(e){t.push(e[0].toLowerCase())})),t},t.disconnectedCallback=function(){this.connected=!1},t.connectedCallback=function(){var e=this;e.parentDOMNode.innerHTML="",e.parentDOMNode.appendChild(e.canvas),e.connected=!0,t.observe(e),t.applyComponentStyle(!0,e),e.resize(!0)},t.adoptedCallback=function(){this.resize()},t.attributeChangedCallback=function(r,l,i){var a,s,c=this;if("style"!==r){if("data"===r)return"application/x-canvas-datagrid"===c.dataType&&(c.dataType="application/json+x-canvas-datagrid"),void(c.data=i);if("schema"!==r)if("name"!==r){if("class"!==r&&"className"!==r){var d,u;if("attributes",d=r,u={},(0,o.Z)(u),s=u.defaults.attributes.filter((function(e){return e[0].toLowerCase()===d.toLowerCase()||t.hyphenateProperty(e[0])===d.toLowerCase()||t.hyphenateProperty(e[0],!0)===d.toLowerCase()}))[0],s)return a=e[n(s[1])],void(c.attributes[s[0]]=a(i));/^on/.test(r)&&c.addEventListener("on"+r,Function("e",i))}}else c.name=i;else c.schema=e.schema(i)}else t.applyComponentStyle(!1,c)},t.observe=function(e){var r;window.MutationObserver&&(e.applyComponentStyle=function(){t.applyComponentStyle(!1,e),e.resize()},(r=new window.MutationObserver((function(t){var r,o;Array.prototype.forEach.call(t,(function(t){"class"!==t.attributeName&&"style"!==t.attributeName&&"STYLE"!==t.target.nodeName?t.target.parentNode&&"STYLE"===t.target.parentNode.nodeName?o=!0:t.target===e&&(t.addedNodes.length>0||"characterData"===t.type)&&(r=!0):o=!0})),o&&e.applyComponentStyle(!1,e),r&&("application/x-canvas-datagrid"===e.dataType&&(e.dataType="application/json+x-canvas-datagrid"),e.data=e.innerHTML)}))).observe(e,{characterData:!0,childList:!0,attributes:!0,subtree:!0}),Array.prototype.forEach.call(document.querySelectorAll("style"),(function(e){r.observe(e,{characterData:!0,childList:!0,attributes:!0,subtree:!0})})))},t}},485:function(e,t,r){"use strict";function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function n(e){var t,r,n;function l(t){e.createInlineStyle(t,"canvas-datagrid-context-menu-item"+(e.mobile?"-mobile":"")),t.addEventListener("mouseover",(function(){e.createInlineStyle(t,"canvas-datagrid-context-menu-item:hover")})),t.addEventListener("mouseout",(function(){e.createInlineStyle(t,"canvas-datagrid-context-menu-item")}))}function i(n,a,s,c){var d,u,f,h=document.createElement("div"),g=document.createElement("div"),m=document.createElement("div"),p=[],v=-1,y={};if(!Array.isArray(s))throw new Error("createContextMenu expects an array.");function x(){h.scrollTop>0?e.parentDOMNode.appendChild(g):g.parentNode&&g.parentNode.removeChild(g),h.scrollTop>=h.scrollHeight-h.offsetHeight&&m.parentNode?m.parentNode.removeChild(m):h.scrollHeight-h.offsetHeight>0&&!(h.scrollTop>=h.scrollHeight-h.offsetHeight)&&e.parentDOMNode.appendChild(m)}function w(t){return function o(){var n=e.attributes.contextHoverScrollAmount;"up"===t&&0===h.scrollTop||"down"===t&&h.scrollTop===h.scrollHeight||(h.scrollTop+="up"===t?-n:n,r=setTimeout(o,e.attributes.contextHoverScrollRateMs,t))}}function C(e){return function(){clearTimeout(r)}}return y.parentGrid=e.intf,y.parentContextMenu=c,y.container=h,u={},f=e.scrollOffset(e.canvas),void 0===t&&(t=e.style.contextMenuZIndex),s.forEach((function(t){var r,a=document.createElement("div");function s(e){e.relatedTarget===h||t.contextMenu.container===e.relatedTarget||r===e.relatedTarget||a===e.relatedTarget||t.contextMenu.container.contains(e.relatedTarget)||(t.contextMenu.dispose(),p.splice(p.indexOf(t.contextMenu),1),t.contextMenu=void 0,a.removeEventListener("mouseout",s),h.removeEventListener("mouseout",s),a.setAttribute("contextOpen","0"),a.setAttribute("opening","0"))}function c(r){if("1"===a.getAttribute("opening")&&"1"!==a.getAttribute("contextOpen")){var o=a.getBoundingClientRect();o={left:o.left+e.style.childContextMenuMarginLeft+h.offsetWidth,top:o.top+e.style.childContextMenuMarginTop,bottom:o.bottom,right:o.right},t.contextMenu=i(n,o,r,y),a.setAttribute("contextOpen","1"),a.addEventListener("mouseout",s),h.addEventListener("mouseout",s),p.push(t.contextMenu)}}function d(){var e;if("1"!==a.getAttribute("contextOpen")){if(a.setAttribute("opening","1"),"function"==typeof t.items)return e=t.items.apply(y,[function(e){c(e)}]),void(void 0!==e&&Array.isArray(e)&&c(e));c(t.items)}}!function(t){!function e(t){if(null!==t)return"function"==typeof t?e(t(n)):void("object"!==o(t)?(l(a),a.innerHTML=t):a.appendChild(t))}(t.title),t.contextItemContainer=a,(t.items&&t.items.length>0||"function"==typeof t.items)&&(r=document.createElement("div"),e.createInlineStyle(r,"canvas-datagrid-context-child-arrow"),r.innerHTML=e.style.childContextMenuArrowHTML,a.appendChild(r),a.addEventListener("mouseover",d),a.addEventListener("mouseout",(function(){a.setAttribute("opening","0")}))),t.click&&a.addEventListener("click",(function(r){t.click.apply(e,[r])}))}(t),h.appendChild(a)})),e.createInlineStyle(h,"canvas-datagrid-context-menu"+(e.mobile?"-mobile":"")),u.x=a.left-f.left,u.y=a.top-f.top,u.height=0,t+=1,h.style.opacity=0,h.style.position="absolute",g.style.color=e.style.contextMenuArrowColor,m.style.color=e.style.contextMenuArrowColor,[g,m].forEach((function(e){e.style.textAlign="center",e.style.position="absolute",e.style.zIndex=t+1})),h.style.zIndex=t,c&&c.inputDropdown&&(h.style.maxHeight=window.innerHeight-u.y-e.style.autocompleteBottomMargin+"px",h.style.minWidth=a.width+"px",u.y+=a.height),e.mobile&&(h.style.width=a.width+"px"),h.style.left=u.x+"px",h.style.top=u.y+"px",h.addEventListener("scroll",x),h.addEventListener("wheel",(function(t){e.hasFocus&&(h.scrollTop+=t.deltaY,h.scrollLeft+=t.deltaX),x()})),g.innerHTML=e.style.contextMenuArrowUpHTML,m.innerHTML=e.style.contextMenuArrowDownHTML,h.appendChild(g),document.body.appendChild(m),document.body.appendChild(h),function(t){var r=.1;t.style.display="block";var o=setInterval((function(){r>=1&&clearInterval(o),t.style.opacity=r,t.style.filter="alpha(opacity="+100*r+")",r+=.1*r}),.1*e.attributes.animationDurationShowContextMenu)}(h),(d=h.getBoundingClientRect()).bottom>window.innerHeight&&(c&&c.inputDropdown||(u.y-=d.bottom+e.style.contextMenuWindowMargin-window.innerHeight),u.y<0&&(u.y=e.style.contextMenuWindowMargin),h.offsetHeight>window.innerHeight-e.style.contextMenuWindowMargin&&(h.style.height=window.innerHeight-2*e.style.contextMenuWindowMargin+"px")),d.right>window.innerWidth&&(u.x-=d.right-window.innerWidth+e.style.contextMenuWindowMargin),u.x<0&&(u.x=e.style.contextMenuWindowMargin),u.y<0&&(u.y=e.style.contextMenuWindowMargin),h.style.left=u.x+"px",h.style.top=u.y+"px",d=h.getBoundingClientRect(),g.style.top=d.top+"px",m.style.top=d.top+d.height-m.offsetHeight+"px",g.style.left=d.left+"px",m.style.left=d.left+"px",m.style.width=h.offsetWidth+"px",g.style.width=h.offsetWidth+"px",m.addEventListener("mouseover",w("down")),m.addEventListener("mouseout",C()),g.addEventListener("mouseover",w("up")),g.addEventListener("mouseout",C()),x(),y.clickIndex=function(e){s[e].contextItemContainer.dispatchEvent(new Event("click"))},y.rect=d,y.items=s,y.upArrow=g,y.downArrow=m,y.dispose=function(){clearTimeout(r),p.forEach((function(e){e.dispose()})),[m,g,h].forEach((function(t){var r,o,n;r=t,o=1,n=setInterval((function(){o<=.1&&(clearInterval(n),r.style.display="none",r.parentNode&&r.parentNode.removeChild(r)),r.style.opacity=o,r.style.filter="alpha(opacity="+100*o+")",o-=.1*o}),.1*e.attributes.animationDurationHideContextMenu)}))},Object.defineProperty(y,"selectedIndex",{get:function(){return v},set:function(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Context menu selected index must be a sane number.");(v=t)>s.length-1&&(v=s.length-1),v<0&&(v=0),s.forEach((function(t,r){if(r===v)return e.createInlineStyle(t.contextItemContainer,"canvas-datagrid-context-menu-item:hover");e.createInlineStyle(t.contextItemContainer,"canvas-datagrid-context-menu-item")}))}}),y}e.disposeAutocomplete=function(){n&&(n.dispose(),n=void 0)},e.disposeContextMenu=function(r){document.removeEventListener("click",e.disposeContextMenu),t=e.style.contextMenuZIndex,e.disposeAutocomplete(),e.contextMenu&&e.contextMenu.dispose(),e.contextMenu=void 0,r&&(e.canvas.focus(),e.mousedown(r),e.mouseup(r))},e.contextmenuEvent=function(t,r){if(e.hasFocus||t.target===e.canvas){for(var o=Object.keys(e.childGrids),a=0;a<o.length;a++){var s=e.childGrids[o[a]],c=s&&s.parentNode;if(c){var d=c.offsetLeft,u=c.offsetWidth,f=c.offsetTop,h=c.offsetHeight;if(0!=(t.x>=d&&t.x<=d+u)&&0!=(t.y>=f&&t.y<=f+h))return}}if(e.isChildGrid&&e.parentNode){var g=e.parentGrid&&e.parentGrid.childGrids;if(!g||!Array.isArray(g))return;if(!g.find((function(t){var r=t.parentNode,o=e.parentNode;return r.offsetTop==o.offsetTop&&r.offsetLeft===o.offsetLeft})))return;for(var m=e.parentNode.offsetLeft,p=e.parentNode.offsetLeft+e.parentNode.offsetWidth,v=e.parentNode.offsetTop,y=e.parentNode.offsetTop+e.parentNode.offsetHeight,x=e.parentNode.parentNode;x;){var w=x,C=w.offsetLeft,b=w.offsetWidth,S=w.offsetTop;C>m&&(m=C),S>v&&(v=S);var B=C+b,R=S+w.offsetHeight;if(B<p&&(p=B),R<y&&(y=R),"canvas-datagrid-tree"!==x.nodeType)break;x=x.parentNode}if(0==(t.x>=m&&t.x<=p&&t.y>=v&&t.y<=y))return}var I,M=[],T=r||e.getLayerPos(t),k={NativeEvent:t,cell:e.getCellAt(T.x,T.y),pos:T,items:M};k.cell.isGrid||function(t){var r,o=e.getSchema(),a=function(){return r||(r=new Map(o.map((function(e){return[e.columnIndex,e]})))),r},s=e.orderings.columns&&e.orderings.columns.length>0,c=!(t.cell.isBackground||t.cell.isColumnHeaderCellCap||t.cell.isScrollBar||t.cell.isCorner||t.cell.isRowHeader)&&t.cell.header;if(e.attributes.showFilter&&c&&function(t){var r,o=document.createElement("div"),l=document.createElement("div"),a=document.createElement("button"),s=document.createElement("input"),c=t.cell&&t.cell.header?t.cell.header.title||t.cell.header.name:"";function d(){s.style.background=e.style.contextFilterInputBackground,s.style.color=e.style.contextFilterInputColor,e.invalidFilterRegEx&&(s.style.background=e.style.contextFilterInvalidRegExpBackground,s.style.color=e.style.contextFilterInvalidRegExpColor)}function u(o){if(!o||!["ArrowDown","ArrowUp","Enter","Tab"].includes(o.key)){var l,a,c,d=(l=0,a={},c=[],e.viewData.forEach((function(r){var o=null==r[t.cell.header.name]?r[t.cell.header.name]:String(r[t.cell.header.name]).trim(),n=e.blankValues.includes(o)?e.attributes.blanksText:o;a[n]||l>e.attributes.maxAutoCompleteItems||(l+=1,a[n]={title:e.formatters[t.cell.header.type||"string"]({cell:{value:n}}),click:function(t){s.value=n,t.stopPropagation(),s.dispatchEvent(new Event("keyup")),e.disposeAutocomplete()}})})),-1!==Object.keys(a).indexOf(e.attributes.blanksText)&&(c.push(a[e.attributes.blanksText]),delete a[e.attributes.blanksText]),c.concat(Object.keys(a).map((function(e){return a[e]}))));r=s.getBoundingClientRect(),n&&(n.dispose(),n=void 0),(n=i(t,{left:r.left,top:r.top,right:r.right,bottom:r.bottom,height:r.height,width:r.width},d,{inputDropdown:!0})).selectedIndex=0}}e.createInlineStyle(l,"canvas-datagrid-context-menu-label"),e.createInlineStyle(a,"canvas-datagrid-context-menu-filter-button"),e.createInlineStyle(s,"canvas-datagrid-context-menu-filter-input"),d(),s.onclick=e.disposeAutocomplete,s.addEventListener("keydown",(function(t){"ArrowDown"===t.key&&(n.selectedIndex+=1),"ArrowUp"===t.key&&(n.selectedIndex-=1),"Enter"===t.key&&(n.clickIndex(n.selectedIndex),e.disposeContextMenu()),"Tab"===t.key&&(n.clickIndex(n.selectedIndex),t.preventDefault()),"Escape"===t.key&&e.disposeContextMenu()})),s.addEventListener("keyup",(function(){e.setFilter(t.cell.header.name,s.value)})),s.addEventListener("keyup",u),["focus","blur","keydown","keyup","change"].forEach((function(e){s.addEventListener(e,d)})),s.value=t.cell.header&&e.columnFilters[t.cell.header.name]||"",l.innerHTML=e.attributes.filterOptionText.replace(/%s/g,c),a.onclick=function(){if(n)return e.disposeAutocomplete();u()},a.innerHTML=e.style.contextFilterButtonHTML,o.addEventListener("click",(function(e){return e.stopPropagation()})),o.appendChild(l),o.appendChild(s),o.appendChild(a),t.items.push({title:o}),Object.keys(e.columnFilters).length&&Object.keys(e.columnFilters).forEach((function(r){var o=e.getHeaderByName(r);t.items.push({title:e.attributes.removeFilterOptionText.replace(/%s/g,o.title||o.name),click:function(t){t.preventDefault(),e.setFilter(r,""),e.controlInput.focus()}})}))}(t),e.attributes.showCopy&&e.canSelectionsBeCopied()&&t.items.push({title:e.attributes.copyText,click:function(){document.execCommand("copy"),e.disposeContextMenu(),e.controlInput.focus()}}),e.attributes.showPaste&&e.clipBoardData&&t.items.push({title:e.attributes.pasteText,click:function(){e.paste(e.clipBoardData),e.draw()}}),e.attributes.showColumnSelector&&(t.items.push({title:e.attributes.columnSelectorText,items:function(){var t=[];return e.getSchema().forEach((function(r){function o(t){r.hidden=!r.hidden,e.dispatchEvent("togglecolumn",{column:r,hidden:r.hidden}),t.preventDefault(),e.stopPropagation(t),e.disposeContextMenu(),e.resize(!0),e.setStorageData()}var n=document.createElement("div");l(n),n.addEventListener("touchstart",o),n.addEventListener("click",o),n.innerHTML=(r.hidden?e.attributes.columnSelectorHiddenText:e.attributes.columnSelectorVisibleText)+(r.title||r.name),t.push({title:n})})),t}}),t.cell&&t.cell.header&&t.cell.columnIndex>-1)){var d=t.cell.columnIndex,u=e.orders.columns[d],f=e.getSelectedContiguousColumns(o),h="";if(f)h=f.map((function(e){return e.title||e.name})).join("-");else{var g=o[u];g&&(h=g.title||g.name)}t.items.push({title:e.attributes.hideColumnText.replace(/%s/gi,h),click:function(t){t.preventDefault(),e.stopPropagation(t),e.disposeContextMenu(),f?e.hideColumns(f[0].orderIndex,f[1].orderIndex):e.hideColumns(d)}})}if(e.attributes.saveAppearance&&e.attributes.showClearSettingsOption&&(Object.keys(e.sizes.rows).length>0||Object.keys(e.sizes.columns).length>0)&&t.items.push({title:e.attributes.clearSettingsOptionText,click:function(t){t.preventDefault(),e.sizes.rows={},e.sizes.columns={},e.createRowOrders(),e.createColumnOrders(),e.storedSettings=void 0,e.dispatchEvent("resizecolumn",{columnWidth:e.style.cellWidth}),e.dispatchEvent("resizerow",{cellHeight:e.style.cellHeight}),e.setStorageData(),e.resize(!0),e.disposeContextMenu(),e.controlInput.focus()}}),e.attributes.allowSorting&&e.attributes.showOrderByOption&&c&&(t.items.push({title:e.attributes.showOrderByOptionTextAsc.replace("%s",t.cell.header.title||t.cell.header.name),click:function(r){r.preventDefault(),e.order(t.cell.header.name,"asc"),e.controlInput.focus()}}),t.items.push({title:e.attributes.showOrderByOptionTextDesc.replace("%s",t.cell.header.title||t.cell.header.name),click:function(r){r.preventDefault(),e.order(t.cell.header.name,"desc"),e.disposeContextMenu(),e.controlInput.focus()}})),!s&&t.cell.isRowHeader&&t.cell.header){var m=e.getSelectedContiguousRows(!0);if(m){var p,v=m.map((function(t){return e.getBoundRowIndexFromViewRowIndex(t)}));1===v.length?(p="number"==typeof v[0]?v[0]+1:m[0]+1,p=e.attributes.showHideRow.replace("%s",p),t.items.push({title:p,click:function(t){t.preventDefault(),e.hideRows(v[0],v[0])}})):v[0]<=v[1]&&(p=v.map((function(e,t){return"number"==typeof e?e+1:m[t]+1})).join("-"),p=e.attributes.showHideRows.replace("%s",p),t.items.push({title:p,click:function(t){t.preventDefault(),e.hideRows(v[0],v[1])}}))}}var y=e.getColumnGroupAreaHeight(),x=e.getRowGroupAreaWidth(),w=function(t,r){if(0!==t.length){for(var o=0;o<t.length;o++)for(var n=t[o],l=0;l<n.length;l++)n[l].collapsed=r;e.refresh()}};t.pos&&t.pos.y<y&&(t.items.push({title:e.attributes.showRemoveAllGroupColumns,click:function(t){t.preventDefault(),e.groupedColumns=[],e.refresh()}}),t.items.push({title:e.attributes.showExpandAllGroupColumns,click:function(t){t.preventDefault(),w(e.groupedColumns,!1)}}),t.items.push({title:e.attributes.showCollapseAllGroupColumns,click:function(t){t.preventDefault(),w(e.groupedColumns,!0)}})),t.pos&&t.pos.x<x&&(t.items.push({title:e.attributes.showRemoveAllGroupRows,click:function(t){t.preventDefault(),e.groupedRows=[],e.refresh()}}),t.items.push({title:e.attributes.showExpandAllGroupRows,click:function(t){t.preventDefault(),w(e.groupedRows,!1)}}),t.items.push({title:e.attributes.showCollapseAllGroupRows,click:function(t){t.preventDefault(),w(e.groupedRows,!0)}}));var C=e.attributes.allowGroupingColumns&&t.cell.isColumnHeader&&t.cell.header&&t.cell.header.index>0,b=e.attributes.allowGroupingColumns&&t.cell.isColumnHeader,S=!s&&e.attributes.allowGroupingRows&&t.cell.isRowHeader&&t.cell.header,B=e.attributes.allowGroupingRows&&t.cell.isRowHeader;if(C){for(var R=[],I=t.cell.header.index,M=I;M>=0&&e.isColumnSelected(M);M--)R[0]=M;for(M=I;e.isColumnSelected(M);M++)R[1]=M;if(M!==I&&2===R.length&&R[1]>R[0]&&e.isNewGroupRangeValid(e.groupedColumns,R[0],R[1])){for(var T=a(),k=[],O=[],E=0;E<R.length;E++){var z=R[E],A=T.get(z);A&&(O.push(A.name),k.push(A.title||A.name||A.index))}O[0]&&O[1]&&t.items.push({title:e.attributes.showGroupColumns.replace("%s",k[0]+"-"+k[1]),click:function(t){t.preventDefault(),e.groupColumns(O[0],O[1]),e.controlInput.focus()}})}}if(b)for(var H=t.cell.columnIndex,P=e.getGroupsColumnBelongsTo(H),L=a(),D=function(r){var o=P[r],n=o.from,l=o.to,i=L.get(n),a=L.get(l);if(i&&a){var s=(i.title||i.name||i.index)+"-"+(a.title||a.name||a.index);t.items.push({title:e.attributes.showRemoveGroupColumns.replace("%s",s),click:function(t){t.preventDefault(),e.removeGroupColumns(i.name,a.name),e.controlInput.focus()}})}else console.warn("Cannot find column ".concat(n," or column ").concat(l))},F=0;F<P.length;F++)D(F);if(S){var W=e.getSelectedContiguousRows(!1)||[],_=W.map((function(t){var r=e.getBoundRowIndexFromViewRowIndex(t);return"number"==typeof r?r+1:t+1})).join("-");2===W.length&&e.isNewGroupRangeValid(e.groupedRows,W[0],W[1])&&t.items.push({title:e.attributes.showGroupRows.replace("%s",_),click:function(t){t.preventDefault(),e.groupRows(W[0],W[1])}})}if(B)for(var j=t.cell.rowIndex,N=e.getGroupsRowBelongsTo(j),G=function(r){var o=N[r],n=o.from,l=o.to,i=[n,l].map((function(t){var r=e.getBoundRowIndexFromViewRowIndex(t);return"number"==typeof r?r+1:t+1})).join("-");t.items.push({title:e.attributes.showRemoveGroupRows.replace("%s",i),click:function(t){t.preventDefault(),e.removeGroupRows(n,l),e.controlInput.focus()}})},V=0;V<N.length;V++)G(V)}(k),"mousedown"!==t.type&&e.dispatchEvent("contextmenu",k)||k.cell.isGrid||(e.contextMenu&&e.disposeContextMenu(),I={left:T.x+T.rect.left+e.style.contextMenuMarginLeft+e.canvasOffsetLeft,top:T.y+T.rect.top+e.style.contextMenuMarginTop+e.canvasOffsetTop,right:k.cell.width+k.cell.x+T.rect.left,bottom:k.cell.height+k.cell.y+T.rect.top,height:k.cell.height,width:k.cell.width},e.mobile&&(I.left=e.style.mobileContextMenuMargin+"px",I.width=e.width-2*e.style.mobileContextMenuMargin+"px"),"mousedown"==t.type&&(I.top+=e.style.filterButtonMenuOffsetTop),e.contextMenu=i(k,I,M),"mousedown"==t.type?window.addEventListener("mouseup",O):O(),t.preventDefault())}function O(){requestAnimationFrame((function(){document.addEventListener("click",e.disposeContextMenu),window.removeEventListener("mouseup",O)}))}}}r.d(t,{Z:function(){return n}})},857:function(e,t,r){"use strict";function o(e){e.defaults={attributes:[["allowColumnReordering",!0],["allowColumnResize",!0],["allowColumnResizeFromCell",!1],["allowFreezingRows",!1],["allowFreezingColumns",!1],["allowMovingSelection",!0],["allowRowHeaderResize",!0],["allowRowReordering",!1],["allowRowResize",!0],["allowRowResizeFromCell",!1],["allowSorting",!0],["allowGroupingRows",!0],["allowGroupingColumns",!0],["animationDurationShowContextMenu",50],["animationDurationHideContextMenu",50],["autoGenerateSchema",!1],["autoResizeColumns",!1],["autoResizeRows",!1],["autoScrollOnMousemove",!1],["autoScrollMargin",5],["allowShrinkingSelection",!1],["blanksText","(Blanks)"],["borderDragBehavior","none"],["borderResizeZone",10],["clearCellsWhenShrinkingSelection",!1],["clearSettingsOptionText","Clear saved settings"],["columnHeaderClickBehavior","sort"],["columnSelectorHiddenText","&nbsp;&nbsp;&nbsp;"],["columnSelectorText","Add/Remove columns"],["columnSelectorVisibleText","✓"],["contextHoverScrollAmount",2],["contextHoverScrollRateMs",5],["copyHeadersOnSelectAll",!0],["copyText","Copy"],["debug",!1],["editable",!0],["ellipsisText","..."],["filterOptionText","Filter %s"],["filterTextPrefix","(filtered) "],["filterFrozenRows",!0],["globalRowResize",!1],["hideColumnText","Hide %s"],["showUnhideColumnsIndicator",!1],["showUnhideRowsIndicator",!1],["showHideRow","Hide row %s"],["showHideRows","Hide rows %s"],["hoverMode","cell"],["keepFocusOnMouseOut",!1],["maxAutoCompleteItems",200],["multiLine",!1],["name",""],["pageUpDownOverlap",1],["pasteText","Paste"],["persistantSelectionMode",!1],["removeFilterOptionText","Remove filter on %s"],["reorderDeadZone",3],["resizeAfterDragged",!1],["resizeScrollZone",20],["rowGrabZoneSize",5],["columnGrabZoneSize",30],["saveAppearance",!0],["scrollAnimationPPSThreshold",.75],["scrollPointerLock",!1],["scrollRepeatRate",75],["selectionFollowsActiveCell",!1],["selectionHandleBehavior","none"],["selectionMode","cell"],["selectionScrollIncrement",20],["selectionScrollZone",20],["showClearSettingsOption",!0],["showColumnHeaders",!0],["showColumnSelector",!0],["showCopy",!1],["showFilter",!0],["showFilterInCell",!1],["showNewRow",!1],["showOrderByOption",!0],["showOrderByOptionTextAsc","Order by %s ascending"],["showOrderByOptionTextDesc","Order by %s descending"],["showGroupColumns","Group columns %s"],["showGroupRows","Group rows %s"],["showRemoveGroupColumns","Remove group %s"],["showRemoveGroupRows","Remove group %s"],["showRemoveAllGroupColumns","Remove all column groups"],["showRemoveAllGroupRows","Remove all row groups"],["showExpandAllGroupColumns","Expand all column groups"],["showExpandAllGroupRows","Expand all row groups"],["showCollapseAllGroupColumns","Collapse all column groups"],["showCollapseAllGroupRows","Collapse all row groups"],["columnGroupIndicatorPosition","right"],["rowGroupIndicatorPosition","bottom"],["showPaste",!1],["showPerformance",!1],["showRowHeaders",!0],["showRowNumbers",!0],["showRowNumberGaps",!0],["singleSelectionMode",!1],["snapToRow",!1],["sortFrozenRows",!0],["touchContextMenuTimeMs",800],["touchDeadZone",3],["touchEasingMethod","easeOutQuad"],["touchReleaseAcceleration",1e3],["touchReleaseAnimationDurationMs",2e3],["touchScrollZone",20],["touchSelectHandleZone",20],["touchZoomSensitivity",.005],["touchZoomMin",.5],["touchZoomMax",1.75],["maxPixelRatio",2],["tree",!1],["treeHorizontalScroll",!1],["rowTree",[]],["rowTreeColIndex",0],["columnTree",[]],["columnTreeRowStartIndex",0],["columnTreeRowEndIndex",0]],styles:[["activeCellBackgroundColor","rgba(255, 255, 255, 1)"],["activeCellBorderColor","rgba(110, 168, 255, 1)"],["activeCellBorderWidth",1],["activeCellColor","rgba(0, 0, 0, 1)"],["activeCellFont","16px sans-serif"],["activeCellHoverBackgroundColor","rgba(255, 255, 255, 1)"],["activeCellHorizontalAlignment","left"],["activeCellHoverColor","rgba(0, 0, 0, 1)"],["activeCellOverlayBorderColor","rgba(66, 133, 244, 1)"],["activeCellOverlayBorderWidth",1],["activeCellPaddingBottom",5],["activeCellPaddingLeft",5],["activeCellPaddingRight",5],["activeCellPaddingTop",5],["activeCellSelectedBackgroundColor","rgba(236, 243, 255, 1)"],["activeCellSelectedColor","rgba(0, 0, 0, 1)"],["activeCellVerticalAlignment","center"],["activeColumnHeaderCellBackgroundColor","rgba(225, 225, 225, 1)"],["activeColumnHeaderCellColor","rgba(0, 0, 0, 1)"],["activeRowHeaderCellBackgroundColor","rgba(225, 225, 225, 1)"],["activeRowHeaderCellColor","rgba(0, 0, 0, 1)"],["autocompleteBottomMargin",60],["autosizeHeaderCellPadding",8],["autosizePadding",5],["buttonActiveBackgroundColor","rgba(255, 255, 255, 1)"],["buttonActiveBorderColor","rgba(110, 168, 255, 1)"],["buttonArrowColor","rgba(50, 50, 50, 1)"],["buttonArrowDownHTML","&#x25BC;"],["buttonZIndex",1e4],["buttonBackgroundColor","rgba(255, 255, 255, 1)"],["buttonBorderColor","rgba(172, 172, 172, 1)"],["buttonHoverBackgroundColor","rgba(240, 240, 240, 1)"],["buttonMenuWindowMargin",30],["buttonPadding","3px"],["cellAutoResizePadding",13],["cellBackgroundColor","rgba(255, 255, 255, 1)"],["cellBorderColor","rgba(195, 199, 202, 1)"],["cellBorderWidth",1],["cellColor","rgba(0, 0, 0, 1)"],["cellFont","16px sans-serif"],["cellGridHeight",250],["cellHeight",24],["cellHeightWithChildGrid",150],["cellHorizontalAlignment","left"],["cellHoverBackgroundColor","rgba(255, 255, 255, 1)"],["cellHoverColor","rgba(0, 0, 0, 1)"],["cellPaddingBottom",5],["cellPaddingLeft",5],["cellPaddingRight",5],["cellPaddingTop",5],["cellSelectedBackgroundColor","rgba(236, 243, 255, 1)"],["cellSelectedColor","rgba(0, 0, 0, 1)"],["cellTreeIconBorderColor","rgba(162, 174, 207, 1)"],["cellTreeIconFillColor","rgba(240, 240, 240, 1)"],["cellTreeIconHoverFillColor","rgba(198, 217, 233, 1)"],["cellTreeIconLineColor","rgba(43, 53, 81, 1)"],["cellTreeIconLineWidth",1.5],["cellTreeIconMarginLeft",0],["cellTreeIconMarginRight",5],["cellTreeIconMarginTop",6],["cellTreeIconWidth",13],["cellVerticalAlignment","center"],["cellWidth",250],["cellWidthWithChildGrid",250],["cellWhiteSpace","nowrap"],["cellLineHeight",1],["cellLineSpacing",3],["childContextMenuArrowColor","rgba(43, 48, 43, 1)"],["childContextMenuArrowHTML","&#x25BA;"],["childContextMenuMarginLeft",-11],["childContextMenuMarginTop",-6],["columnGroupRowHeight",25],["columnHeaderCellBackgroundColor","rgba(240, 240, 240, 1)"],["columnHeaderCellBorderColor","rgba(172, 172, 172, 1)"],["columnHeaderCellBorderWidth",1],["columnHeaderCellCapBackgroundColor","rgba(240, 240, 240, 1)"],["columnHeaderCellCapBorderColor","rgba(172, 172, 172, 1)"],["columnHeaderCellCapBorderWidth",1],["columnHeaderCellColor","rgba(50, 50, 50, 1)"],["columnHeaderCellFont","16px sans-serif"],["columnHeaderCellHeight",25],["columnHeaderCellHorizontalAlignment","left"],["columnHeaderCellHoverBackgroundColor","rgba(235, 235, 235, 1)"],["columnHeaderCellHoverColor","rgba(0, 0, 0, 1)"],["columnHeaderCellPaddingBottom",5],["columnHeaderCellPaddingLeft",5],["columnHeaderCellPaddingRight",5],["columnHeaderCellPaddingTop",5],["columnHeaderCellVerticalAlignment","center"],["columnHeaderOrderByArrowBorderColor","rgba(195, 199, 202, 1)"],["columnHeaderOrderByArrowBorderWidth",1],["columnHeaderOrderByArrowColor","rgba(155, 155, 155, 1)"],["columnHeaderOrderByArrowHeight",8],["columnHeaderOrderByArrowMarginLeft",0],["columnHeaderOrderByArrowMarginRight",5],["columnHeaderOrderByArrowMarginTop",6],["columnHeaderOrderByArrowWidth",13],["contextFilterButtonBorder","solid 1px rgba(158, 163, 169, 1)"],["contextFilterButtonBorderRadius","3px"],["contextFilterButtonHTML","&#x25BC;"],["contextFilterInputBackground","rgba(255,255,255,1)"],["contextFilterInputBorder","solid 1px rgba(158, 163, 169, 1)"],["contextFilterInputBorderRadius","0"],["contextFilterInputColor","rgba(0,0,0,1)"],["contextFilterInputFontFamily","sans-serif"],["contextFilterInputFontSize","14px"],["contextFilterInvalidRegExpBackground","rgba(180, 6, 1, 1)"],["contextFilterInvalidRegExpColor","rgba(255, 255, 255, 1)"],["contextMenuArrowColor","rgba(43, 48, 43, 1)"],["contextMenuArrowDownHTML","&#x25BC;"],["contextMenuArrowUpHTML","&#x25B2;"],["contextMenuBackground","rgba(240, 240, 240, 1)"],["contextMenuBorder","solid 1px rgba(158, 163, 169, 1)"],["contextMenuBorderRadius","3px"],["contextMenuChildArrowFontSize","12px"],["contextMenuColor","rgba(43, 48, 43, 1)"],["contextMenuCursor","default"],["contextMenuFilterButtonFontFamily","sans-serif"],["contextMenuFilterButtonFontSize","10px"],["contextMenuFilterInvalidExpresion","rgba(237, 155, 156, 1)"],["contextMenuFontFamily","sans-serif"],["contextMenuFontSize","16px"],["contextMenuHoverBackground","rgba(182, 205, 250, 1)"],["contextMenuHoverColor","rgba(43, 48, 153, 1)"],["contextMenuItemBorderRadius","3px"],["contextMenuItemMargin","2px"],["contextMenuLabelDisplay","inline-block"],["contextMenuLabelMargin","0 3px 0 0"],["contextMenuLabelMaxWidth","700px"],["contextMenuLabelMinWidth","75px"],["contextMenuMarginLeft",3],["contextMenuMarginTop",-3],["contextMenuOpacity","0.98"],["contextMenuPadding","2px"],["contextMenuWindowMargin",30],["contextMenuZIndex",1e4],["cornerCellBackgroundColor","rgba(240, 240, 240, 1)"],["cornerCellBorderColor","rgba(202, 202, 202, 1)"],["debugBackgroundColor","rgba(0, 0, 0, .0)"],["debugColor","rgba(255, 15, 24, 1)"],["debugEntitiesColor","rgba(76, 231, 239, 1.00)"],["debugFont","11px sans-serif"],["debugPerfChartBackground","rgba(29, 25, 26, 1.00)"],["debugPerfChartTextColor","rgba(255, 255, 255, 0.8)"],["debugPerformanceColor","rgba(252, 255, 37, 1.00)"],["debugScrollHeightColor","rgba(248, 33, 103, 1.00)"],["debugScrollWidthColor","rgba(66, 255, 27, 1.00)"],["debugTouchPPSXColor","rgba(246, 102, 24, 1.00)"],["debugTouchPPSYColor","rgba(186, 0, 255, 1.00)"],["display","inline-block"],["editCellBackgroundColor","white"],["editCellBorder","solid 1px rgba(110, 168, 255, 1)"],["editCellBoxShadow","0 2px 5px rgba(0,0,0,0.4)"],["editCellColor","black"],["editCellFontFamily","sans-serif"],["editCellFontSize","16px"],["editCellPaddingLeft",4],["editCellZIndex",1e4],["filterButtonActiveBackgroundColor","rgba(225, 225, 225, 1)"],["filterButtonArrowBorderColor","rgba(195, 199, 202, 1)"],["filterButtonArrowBorderWidth",1],["filterButtonArrowClickRadius",5],["filterButtonArrowColor","rgba(50, 50, 50, 1)"],["filterButtonArrowHeight",5],["filterButtonArrowWidth",8],["filterButtonBackgroundColor","rgba(240, 240, 240, 1)"],["filterButtonBorderColor","rgba(172, 172, 172, 1)"],["filterButtonBorderRadius",3],["filterButtonHeight",20],["filterButtonHoverBackgroundColor","rgba(235, 235, 235, 1)"],["filterButtonMenuOffsetTop",10],["filterButtonWidth",20],["frozenMarkerHoverColor","rgba(165, 198, 254, 1)"],["frozenMarkerHoverBorderColor","rgba(165, 198, 254, 1)"],["frozenMarkerActiveColor","rgba(165, 198, 254, 0.2)"],["frozenMarkerActiveBorderColor","rgba(165, 198, 254, 0.5)"],["frozenMarkerActiveHeaderColor","rgba(165, 198, 254, 1)"],["frozenMarkerColor","rgba(221, 221, 221, 1)"],["frozenMarkerBorderColor","rgba(221, 221, 221, 1)"],["frozenMarkerBorderWidth",1],["frozenMarkerHeaderColor","rgba(188, 188, 188, 1)"],["frozenMarkerWidth",4],["groupingAreaBackgroundColor","rgba(240, 240, 240, 1)"],["gridBackgroundColor","rgba(240, 240, 240, 1)"],["gridBorderCollapse","collapse"],["gridBorderColor","rgba(202, 202, 202, 1)"],["gridBorderWidth",1],["groupIndicatorColor","rgba(155, 155, 155, 1)"],["groupIndicatorBackgroundColor","rgba(255, 255, 255, 1)"],["height","auto"],["maxHeight","inherit"],["maxWidth","inherit"],["minColumnWidth",45],["minHeight","inherit"],["minRowHeight",24],["minWidth","inherit"],["mobileContextMenuMargin",10],["mobileEditInputHeight",30],["mobileEditFontFamily","sans-serif"],["mobileEditFontSize","16px"],["moveOverlayBorderWidth",1],["moveOverlayBorderColor","rgba(66, 133, 244, 1)"],["moveOverlayBorderSegments","12, 7"],["name","default"],["overflowY","auto"],["overflowX","auto"],["reorderMarkerBackgroundColor","rgba(0, 0, 0, 0.1)"],["reorderMarkerBorderColor","rgba(0, 0, 0, 0.2)"],["reorderMarkerBorderWidth",1.25],["reorderMarkerIndexBorderColor","rgba(66, 133, 244, 1)"],["reorderMarkerIndexBorderWidth",2.75],["resizeMarkerColor","rgba(0, 0, 0, 0.2)"],["resizeMarkerSize",2],["rowGroupColumnWidth",25],["rowHeaderCellBackgroundColor","rgba(240, 240, 240, 1)"],["rowHeaderCellBorderColor","rgba(200, 200, 200, 1)"],["rowHeaderCellBorderWidth",1],["rowHeaderCellColor","rgba(50, 50, 50, 1)"],["rowHeaderCellFont","16px sans-serif"],["rowHeaderCellHeight",25],["rowHeaderCellHorizontalAlignment","left"],["rowHeaderCellHoverBackgroundColor","rgba(235, 235, 235, 1)"],["rowHeaderCellHoverColor","rgba(0, 0, 0, 1)"],["rowHeaderCellPaddingBottom",5],["rowHeaderCellPaddingLeft",5],["rowHeaderCellPaddingRight",5],["rowHeaderCellPaddingTop",5],["rowHeaderCellRowNumberGapHeight",5],["rowHeaderCellRowNumberGapColor","rgba(50, 50, 50, 1)"],["rowHeaderCellSelectedBackgroundColor","rgba(217, 217, 217, 1)"],["rowHeaderCellSelectedColor","rgba(50, 50, 50, 1)"],["rowHeaderCellVerticalAlignment","center"],["rowHeaderCellWidth",57],["scrollBarActiveColor","rgba(125, 125, 125, 1)"],["scrollBarBackgroundColor","rgba(240, 240, 240, 1)"],["scrollBarBorderColor","rgba(202, 202, 202, 1)"],["scrollBarBorderWidth",.5],["scrollBarBoxBorderRadius",4.125],["scrollBarBoxColor","rgba(192, 192, 192, 1)"],["scrollBarBoxMargin",2],["scrollBarBoxMinSize",15],["scrollBarBoxWidth",8],["scrollBarCornerBackgroundColor","rgba(240, 240, 240, 1)"],["scrollBarCornerBorderColor","rgba(202, 202, 202, 1)"],["scrollBarWidth",11],["selectionHandleBorderColor","rgba(255, 255, 255, 1)"],["selectionHandleBorderWidth",1.5],["selectionHandleColor","rgba(66, 133, 244, 1)"],["selectionHandleSize",8],["selectionHandleType","square"],["fillOverlayBorderColor","rgba(127, 127, 127, 1)"],["fillOverlayBorderWidth",2],["selectionOverlayBorderColor","rgba(66, 133, 244, 1)"],["selectionOverlayBorderWidth",1],["treeArrowBorderColor","rgba(195, 199, 202, 1)"],["treeArrowBorderWidth",1],["treeArrowClickRadius",5],["treeArrowColor","rgba(155, 155, 155, 1)"],["treeArrowHeight",8],["treeArrowMarginLeft",0],["treeArrowMarginRight",5],["treeArrowMarginTop",6],["treeArrowWidth",13],["treeGridHeight",250],["unhideIndicatorColor","rgba(0, 0, 0, 1)"],["unhideIndicatorBackgroundColor","rgba(255, 255, 255, 1)"],["unhideIndicatorBorderColor","rgba(174, 193, 232, 1)"],["unhideIndicatorSize",16],["width","auto"]]}}r.d(t,{Z:function(){return o}})},251:function(e,t,r){"use strict";function o(e){e.getClippingRect=function(t){var r=e.position(e.parentNode),o=e.position(t),n=e.scrollOffset(e.canvas),l={x:0,y:0,h:0,w:0},i={x:-1/0,y:-1/0,h:1/0,w:1/0},a=e.getColumnHeaderCellHeight(),s=e.getRowHeaderCellWidth();return r.top-=n.top,r.left-=n.left,o.top-=n.top,o.left-=n.left,l.h=r.top+r.height-t.offsetTop-e.style.scrollBarWidth,l.w=r.left+r.width-t.offsetLeft-e.style.scrollBarWidth,l.x=r.left+-1*o.left+s,l.y=r.top+-1*o.top+a,{x:l.x>i.x?l.x:i.x,y:l.y>i.y?l.y:i.y,h:l.h<i.h?l.h:i.h,w:l.w<i.w?l.w:i.w}},e.clipElement=function(t){var r=e.getClippingRect(t);r.w<0&&(r.w=0),r.h<0&&(r.h=0),t.style.clip="rect("+r.y+"px,"+r.w+"px,"+r.h+"px,"+r.x+"px)"},e.scrollOffset=function(t){for(var r=0,o=0,n=document.scrollingElement||{scrollLeft:0,scrollTop:0};t.parentNode&&"CANVAS-DATAGRID"!==t.nodeName&&t!==e.intf;)"canvas-datagrid-tree"!==t.nodeType&&"canvas-datagrid-cell"!==t.nodeType&&(r-=t.scrollLeft,o-=t.scrollTop),t=t.parentNode;return{left:r-n.scrollLeft,top:o-n.scrollTop}},e.resizeEditInput=function(){if(e.input&&e.input.editCell){var t=e.canvas.getBoundingClientRect(),r=e.scrollOffset(e.intf),o="collapse"===e.style.gridBorderCollapse?1:2,n=e.style.cellBorderWidth*o,l=e.getVisibleCellByIndex(e.input.editCell.columnIndex,e.input.editCell.rowIndex)||{x:-100,y:-100,height:0,width:0};if(e.mobile)return e.input.style.left="0",e.input.style.top=e.height-e.style.mobileEditInputHeight-n-1+"px",e.input.style.height=e.style.mobileEditInputHeight+"px",void(e.input.style.width=e.width-n-1+"px");var i=e.getColumnGroupAreaHeight(),a=e.getRowGroupAreaWidth();if(e.parentNode){var s=e.parentNode,c=s.columnGroupsAreaHeight,d=s.rowGroupsAreaWidth;c&&(i+=c),d&&(a+=d)}e.input.style.left=t.left+l.x+e.canvasOffsetLeft-r.left+a+"px",e.input.style.top=t.top+l.y-e.style.cellBorderWidth+e.canvasOffsetTop-r.top+i+"px",e.input.style.height=l.height-n+"px",e.input.style.width=l.width-e.style.cellPaddingLeft+"px",e.clipElement(e.input)}},e.position=function(t,r){for(var o,n,l=0,i=0,a=t,s=!1;t.offsetParent&&"CANVAS-DATAGRID"!==t.nodeName;){var c="canvas-datagrid-tree"===t.nodeType;c&&s||(l+=t.offsetLeft,i+=t.offsetTop,o=t.offsetHeight,n=t.offsetWidth),c&&(s=!0),t=t.offsetParent}return r?{left:l,top:i,height:o,width:n}:(t=a,{left:l+(a=e.scrollOffset(t)).left,top:i+a.top,height:o,width:n})},e.getLayerPos=function(t){var r=e.canvas.getBoundingClientRect(),o={x:t.clientX-r.left,y:t.clientY-r.top};return e.isChildGrid&&(o.x-=e.canvasOffsetLeft,o.y-=e.canvasOffsetTop,e.parentNode.rowGroupsAreaWidth&&(o.x-=e.parentNode.rowGroupsAreaWidth),e.parentNode.columnGroupsAreaHeight&&(o.y-=e.parentNode.columnGroupsAreaHeight)),{x:o.x,y:o.y,rect:r}},e.endEdit=function(t){var r=e.input.editCell,o=r.rowIndex;if(e.dispatchEvent("beforeendedit",{cell:r,newValue:e.input.value,oldValue:r.value,abort:function(){t=!0},input:e.input}))return!1;if(e.input.value!==r.value&&!t){if(e.changes[o]=e.changes[o]||{},e.changes[o][r.header.name]=e.input.value,r.data||(e.originalData[r.boundRowIndex]={},r.data=e.originalData[r.boundRowIndex]),r.data[r.header.name]=e.input.value,o===e.viewData.length){if(e.dispatchEvent("newrow",{value:e.input.value,defaultValue:r.value,aborted:t,cell:r,input:e.input}))return!1;e.addRow(r.data),e.createNewRowData()}e.draw(!0)}return e.input.parentNode&&e.input.parentNode.removeChild(e.input),e.intf.focus(),e.dispatchEvent("endedit",{cell:r,value:e.input.value,aborted:t,input:e.input}),e.input=void 0,!0},e.beginEditAt=function(t,r,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.attributes.editable){e.input&&e.endEdit();var l,i,a,s,c,d=e.getVisibleCellByIndex(t,r);if(e.getSchema(),d&&d.header){if(a=d.header.enum,e.dispatchEvent("beforebeginedit",{cell:d,NativeEvent:o}))return!1;if(e.scrollIntoView(t,r),e.setActiveCell(t,r),l=e.getAdjacentCells(),e.input=a?document.createElement("select"):document.createElement(e.attributes.multiLine?"textarea":"input"),d=e.getVisibleCellByIndex(t,r)){a&&("function"==typeof a?i=a.apply(e.intf,[{cell:d}]):Array.isArray(a)&&(i=a),i.forEach((function(t){var r,o,n=document.createElement("option");Array.isArray(t)?(r=t[0],o=t[1]):(r=t,o=t),r===d.value&&(c=!0),n.value=r,n.innerHTML=o,e.input.appendChild(n)})),c||((s=document.createElement("option")).value=d.value,s.innerHTML=d.value,e.input.appendChild(s)),e.input.addEventListener("change",(function(){e.endEdit(),e.draw(!0)}))),e.dispatchEvent("appendeditinput",{cell:d,input:e.input})||document.body.appendChild(e.input),e.createInlineStyle(e.input,e.mobile?"canvas-datagrid-edit-mobile-input":"canvas-datagrid-edit-input"),e.input.style.position="absolute",e.input.editCell=d,e.resizeEditInput(),e.input.style.zIndex=e.style.editCellZIndex,e.input.style.fontSize=parseInt(e.style.editCellFontSize,10)*e.scale+"px";var u=-1!==[null,void 0].indexOf(d.value)||n;e.input.value=u?"":d.value;var f=Math.round(e.input.value.length*parseInt(e.style.editCellFontSize,10)*.7*e.scale);f+e.style.cellPaddingLeft<d.width?f=d.width-e.style.cellPaddingLeft:f>e.width-d.x-e.style.scrollBarWidth&&(f=e.width-d.x-e.style.scrollBarWidth,e.input.style.height="auto"),e.input.style.width=f+"px",e.input.focus(),e.input.addEventListener("click",e.stopPropagation),e.input.addEventListener("dblclick",e.stopPropagation),e.input.addEventListener("mouseup",e.stopPropagation),e.input.addEventListener("mousedown",e.stopPropagation),e.input.addEventListener("keydown",(function(r){var o=d.columnIndex,i=d.rowIndex;if("Escape"===r.key)e.endEdit(!0),e.draw(!0);else if("Enter"===r.key&&e.attributes.multiLine&&r.altKey)e.input.value=e.input.value+"\n",e.input.scrollTop=e.input.scrollHeight;else if("Enter"===r.key){e.endEdit();var a=r.shiftKey?Math.max(0,i-1):Math.min(i+1,e.viewData.length-1);a!==i&&(e.scrollIntoView(o,a),e.setActiveCell(o,a)),e.draw(!0)}else if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.key)&&n){switch(r.key){case"ArrowUp":i=Math.max(0,i-1);break;case"ArrowDown":i=Math.min(i+1,e.viewData.length-1);break;case"ArrowLeft":o=Math.max(o-1,0);break;case"ArrowRight":o=l.right}e.endEdit(),e.scrollIntoView(o,i),e.setActiveCell(o,i),e.draw(!0)}else if("Tab"===r.key){if(r.preventDefault(),!e.endEdit())return;o=r.shiftKey?l.left:l.right,l.left===t&&r.shiftKey&&(o=l.last,i-=1),l.right!==t||r.shiftKey||(o=l.first,i+=1),i<0&&(i=e.viewData.length-1),i>e.viewData.length-1&&(i=0),e.scrollIntoView(o,i),e.beginEditAt(o,i,r)}else{var s=Math.round(e.input.value.length*parseInt(e.style.editCellFontSize,10)*.7*e.scale);s+e.style.cellPaddingLeft<d.width?s=d.width-e.style.cellPaddingLeft:s>e.width-d.x-e.style.scrollBarWidth&&(s=e.width-d.x-e.style.scrollBarWidth,e.input.style.height="auto"),e.input.style.width=s+"px"}})),e.dispatchEvent("beginedit",{cell:d,input:e.input})}}}},e.createInlineStyle=function(t,r){var o={"canvas-datagrid-button-wrapper":{display:"inline-block",padding:e.style.buttonPadding,borderWidth:"1px",borderStyle:"solid",borderColor:e.style.buttonBorderColor,cursor:"pointer",background:e.style.buttonBackgroundColor,userSelect:"none"},"canvas-datagrid-button-wrapper:hover":{borderColor:e.style.buttonBorderColor,background:e.style.buttonHoverBackgroundColor},"canvas-datagrid-button-wrapper:active":{borderColor:e.style.buttonActiveBorderColor,background:e.style.buttonActiveBackgroundColor},"canvas-datagrid-button-icon":{width:"18px",height:"18px",display:"inline-block",verticalAlign:"middle"},"canvas-datagrid-button-arrow":{display:"inline-block",color:e.style.buttonArrowColor,fontSize:"9px"},"canvas-datagrid-button-menu-item-mobile":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,color:"inherit",background:"inherit",margin:e.style.contextMenuItemMargin,borderRadius:e.style.contextMenuItemBorderRadius,verticalAlign:"middle"},"canvas-datagrid-button-menu-item":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,color:"inherit",background:"inherit",margin:e.style.contextMenuItemMargin,borderRadius:e.style.contextMenuItemBorderRadius,verticalAlign:"middle"},"canvas-datagrid-button-menu-item:hover":{background:e.style.contextMenuHoverBackground,color:e.st